ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkMIRegistrationFunction.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 itkMIRegistrationFunction_h
19 #define itkMIRegistrationFunction_h
20 
22 #include "itkPoint.h"
25 
26 namespace itk
27 {
52 template< typename TFixedImage, typename TMovingImage, typename TDisplacementField >
53 class ITK_TEMPLATE_EXPORT MIRegistrationFunction:
54  public PDEDeformableRegistrationFunction< TFixedImage,
55  TMovingImage, TDisplacementField >
56 {
57 public:
58 
61  typedef PDEDeformableRegistrationFunction< TFixedImage,
62  TMovingImage, TDisplacementField > Superclass;
65 
67  itkNewMacro(Self);
68 
70  itkTypeMacro(MIRegistrationFunction,
72 
74  typedef typename Superclass::MovingImageType MovingImageType;
75  typedef typename Superclass::MovingImagePointer MovingImagePointer;
76 
79  typedef typename Superclass::FixedImagePointer FixedImagePointer;
82  typedef typename FixedImageType::SpacingType SpacingType;
83 
85  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
86  typedef typename Superclass::DisplacementFieldTypePointer
88 
90  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
91 
93  typedef typename Superclass::PixelType PixelType;
98 
100  typedef double CoordRepType;
106 
109 
113 
116  { m_MovingImageInterpolator = ptr; }
117 
120  { return m_MovingImageInterpolator; }
121 
123  virtual TimeStepType ComputeGlobalTimeStep( void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
124  { return m_TimeStep; }
125 
128  virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
129  {
130  GlobalDataStruct *global = new GlobalDataStruct();
131 
132  return global;
133  }
134 
136  virtual void ReleaseGlobalDataPointer(void *GlobalData) const ITK_OVERRIDE
137  { delete (GlobalDataStruct *)GlobalData; }
138 
140  virtual void InitializeIteration() ITK_OVERRIDE;
141 
145  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
146  void *globalData,
147  const FloatOffsetType & offset = FloatOffsetType(0.0) ) ITK_OVERRIDE;
148 
149  void SetMinNorm( float ts = 1.0 )
150  { m_Minnorm = ts; }
151 
152  void SetDoInverse( bool b = false )
153  { m_DoInverse = b; }
154 
155 protected:
157  ~MIRegistrationFunction() ITK_OVERRIDE {}
158  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
159 
162 
167  };
168 
169 private:
170  ITK_DISALLOW_COPY_AND_ASSIGN(MIRegistrationFunction);
171 
174 
177 
180 
182 
185 
188 
189  mutable double m_MetricTotal;
190 
191  unsigned int m_NumberOfSamples;
192  unsigned int m_NumberOfBins;
193  float m_Minnorm;
194 
196 };
197 } // end namespace itk
198 
199 #ifndef ITK_MANUAL_INSTANTIATION
200 #include "itkMIRegistrationFunction.hxx"
201 #endif
202 
203 #endif
CentralDifferenceImageFunction< FixedImageType > GradientCalculatorType
Superclass::FixedImageType FixedImageType
FixedImageNeighborhoodIteratorType m_FixedImageIterator
Light weight base class for most itk classes.
InterpolatorType::Pointer InterpolatorPointer
Superclass::NeighborhoodType NeighborhoodType
FixedImageType::SpacingType SpacingType
FixedImageType::SizeType SizeType
void SetMovingImageInterpolator(InterpolatorType *ptr)
virtual void * GetGlobalDataPointer() const override
Superclass::FixedImagePointer FixedImagePointer
virtual TimeStepType ComputeGlobalTimeStep(void *) const override
ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
Calculate the derivative by central differencing.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
InterpolatorType::PointType PointType
Superclass::FloatOffsetType FloatOffsetType
FixedImageType::IndexType IndexType
Superclass::DisplacementFieldTypePointer DisplacementFieldTypePointer
PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
GradientCalculatorType::Pointer GradientCalculatorPointer
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Superclass::TimeStepType TimeStepType
virtual void ReleaseGlobalDataPointer(void *GlobalData) const override
InterpolateImageFunction< MovingImageType, CoordRepType > InterpolatorType
SmartPointer< const Self > ConstPointer
InterpolatorType * GetMovingImageInterpolator(void)
Linearly interpolate an image at specified positions.
Base class for all image interpolaters.
Superclass::MovingImagePointer MovingImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
CovariantVector< double, itkGetStaticConstMacro(ImageDimension) > CovariantVectorType
Superclass::DisplacementFieldType DisplacementFieldType
GradientCalculatorPointer m_MovingImageGradientCalculator
Superclass::MovingImageType MovingImageType
ConstNeighborhoodIterator< FixedImageType > FixedImageNeighborhoodIteratorType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
A templated class holding a n-Dimensional covariant vector.
InterpolatorPointer m_MovingImageInterpolator
GradientCalculatorPointer m_FixedImageGradientCalculator
LinearInterpolateImageFunction< MovingImageType, CoordRepType > DefaultInterpolatorType