ITK  5.4.0
Insight Toolkit
itkFiniteDifferenceFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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_MOVE(FiniteDifferenceFunction);
77 
79  itkOverrideGetNameOfClassMacro(FiniteDifferenceFunction);
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
122  {}
123 
137  virtual PixelType
138  ComputeUpdate(const NeighborhoodType & neighborhood,
139  void * globalData,
140  const FloatOffsetType & offset = FloatOffsetType(0.0)) = 0;
141 
142 
145  void
146  SetRadius(const RadiusType & r);
147 
150  const RadiusType &
151  GetRadius() const;
152 
156  void
157  SetScaleCoefficients(const PixelRealType vals[ImageDimension]);
158 
160  void
161  GetScaleCoefficients(PixelRealType vals[ImageDimension]) const;
162 
166  const NeighborhoodScalesType
167  ComputeNeighborhoodScales() const;
168 
175  virtual TimeStepType
176  ComputeGlobalTimeStep(void * GlobalData) const = 0;
177 
185  virtual void *
186  GetGlobalDataPointer() const = 0;
187 
193  virtual void
194  ReleaseGlobalDataPointer(void * GlobalData) const = 0;
195 
196 protected:
198  ~FiniteDifferenceFunction() override = default;
199 
200  void
201  PrintSelf(std::ostream & os, Indent indent) const override;
202 
203  RadiusType m_Radius{};
204  PixelRealType m_ScaleCoefficients[ImageDimension]{};
205 };
206 } // end namespace itk
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 # include "itkFiniteDifferenceFunction.hxx"
210 #endif
211 
212 #endif
itk::FiniteDifferenceFunction::InitializeIteration
virtual void InitializeIteration()
Definition: itkFiniteDifferenceFunction.h:121
itk::FiniteDifferenceFunction< TSparseImageType >::RadiusType
typename ConstNeighborhoodIterator< TSparseImageType >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itkConstNeighborhoodIterator.h
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::FiniteDifferenceFunction< TSparseImageType >::PixelRealType
double PixelRealType
Definition: itkFiniteDifferenceFunction.h:84
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FiniteDifferenceFunction< TSparseImageType >::ImageType
TSparseImageType ImageType
Definition: itkFiniteDifferenceFunction.h:82
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::FiniteDifferenceFunction< TSparseImageType >::PixelType
typename ImageType::PixelType PixelType
Definition: itkFiniteDifferenceFunction.h:83
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itkVector.h
itk::FiniteDifferenceFunction
Definition: itkFiniteDifferenceFunction.h:66
itk::ZeroFluxNeumannBoundaryCondition< ImageType >
itkLightObject.h
itk::FiniteDifferenceFunction< TSparseImageType >::TimeStepType
double TimeStepType
Definition: itkFiniteDifferenceFunction.h:90