ITK  4.13.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 
75 
78 
80  typedef TImageType ImageType;
81  typedef typename ImageType::PixelType PixelType;
82  typedef double PixelRealType;
83 
85  itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
86 
88  typedef double TimeStepType;
89 
94 
97 
101 
105 
109 
119  virtual void InitializeIteration() {}
120 
134  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
135  void *globalData,
136  const FloatOffsetType & offset = FloatOffsetType(0.0) ) = 0;
137 
138 
141  void SetRadius(const RadiusType & r);
142 
145  const RadiusType & GetRadius() const;
146 
150  void SetScaleCoefficients(PixelRealType vals[ImageDimension]);
151 
153  void GetScaleCoefficients(PixelRealType vals[ImageDimension]) const;
154 
158  const NeighborhoodScalesType ComputeNeighborhoodScales() const;
159 
166  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const = 0;
167 
175  virtual void * GetGlobalDataPointer() const = 0;
176 
182  virtual void ReleaseGlobalDataPointer(void *GlobalData) const = 0;
183 
184 protected:
186  ~FiniteDifferenceFunction() ITK_OVERRIDE {}
187 
188  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
189 
191  PixelRealType m_ScaleCoefficients[ImageDimension];
192 
193 private:
194  ITK_DISALLOW_COPY_AND_ASSIGN(FiniteDifferenceFunction);
195 };
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 #include "itkFiniteDifferenceFunction.hxx"
200 #endif
201 
202 #endif
Light weight base class for most itk classes.
Vector< PixelRealType, itkGetStaticConstMacro(ImageDimension) > NeighborhoodScalesType
ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType > NeighborhoodType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Vector< float, itkGetStaticConstMacro(ImageDimension) > FloatOffsetType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ZeroFluxNeumannBoundaryCondition< ImageType > DefaultBoundaryConditionType
SmartPointer< const Self > ConstPointer