ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkFiniteDifferenceFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkFiniteDifferenceFunction_h
19 #define itkFiniteDifferenceFunction_h
20 
21 #include "itkLightObject.h"
23 #include "itkVector.h"
24 
25 namespace itk
26 {
65 template< typename TImageType >
66 class ITK_TEMPLATE_EXPORT FiniteDifferenceFunction:public LightObject
67 {
68 public:
69  ITK_DISALLOW_COPY_AND_ASSIGN(FiniteDifferenceFunction);
71 
77 
80 
82  using ImageType = TImageType;
83  using PixelType = typename ImageType::PixelType;
84  using PixelRealType = double;
85 
87  static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
88 
90  using TimeStepType = double;
91 
95 
98 
102 
106 
110 
120  virtual void InitializeIteration() {}
121 
135  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
136  void *globalData,
137  const FloatOffsetType & offset = FloatOffsetType(0.0) ) = 0;
138 
139 
142  void SetRadius(const RadiusType & r);
143 
146  const RadiusType & GetRadius() const;
147 
151  void SetScaleCoefficients(PixelRealType vals[ImageDimension]);
152 
154  void GetScaleCoefficients(PixelRealType vals[ImageDimension]) const;
155 
159  const NeighborhoodScalesType ComputeNeighborhoodScales() const;
160 
167  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const = 0;
168 
176  virtual void * GetGlobalDataPointer() const = 0;
177 
183  virtual void ReleaseGlobalDataPointer(void *GlobalData) const = 0;
184 
185 protected:
187  ~FiniteDifferenceFunction() override = default;
188 
189  void PrintSelf(std::ostream & os, Indent indent) const override;
190 
192  PixelRealType m_ScaleCoefficients[ImageDimension];
193 };
194 } // end namespace itk
195 
196 #ifndef ITK_MANUAL_INSTANTIATION
197 #include "itkFiniteDifferenceFunction.hxx"
198 #endif
199 
200 #endif
Light weight base class for most itk classes.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TSparseImageType >::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Control indentation during Print() invocation.
Definition: itkIndent.h:49