Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
itkBSplineImageToImageRegistrationMethod.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: BSplineRegistrator.h,v $
5  Language: C++
6  Date: $Date: 2006/11/06 14:39:34 $
7  Version: $Revision: 1.15 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef itkBSplineImageToImageRegistrationMethod_h
19 #define itkBSplineImageToImageRegistrationMethod_h
20 
21 #include "itkImage.h"
22 #include "itkBSplineDeformableTransform.h"
23 
25 
26 namespace itk
27 {
28 
29 template <class TImage>
32 {
33 
34 public:
35 
38  typedef SmartPointer<Self> Pointer;
39  typedef SmartPointer<const Self> ConstPointer;
40 
43 
44  itkNewMacro( Self );
45 
46  //
47  // Typedefs from Superclass
48  //
49  typedef TImage ImageType;
50  itkStaticConstMacro( ImageDimension, unsigned int,
51  TImage::ImageDimension );
52 
53  // Overrides the superclass' TransformType typedef
54  typedef BSplineDeformableTransform<double,
55  itkGetStaticConstMacro( ImageDimension ),
56  itkGetStaticConstMacro( ImageDimension )>
58 
59  typedef typename BSplineTransformType::Pointer BSplineTransformPointer;
60 
62 
63  typedef typename BSplineTransformType::ParametersType ParametersType;
64 
65  //
66  // Methods from Superclass
67  //
68 
69  void GenerateData() override;
70 
71  //
72  // Custom Methods
73  //
74 
82 
83  virtual const TransformType* GetTypedTransform() const;
84 
85  itkSetMacro( ExpectedDeformationMagnitude, double );
86  itkGetConstMacro( ExpectedDeformationMagnitude, double );
87 
88  itkSetClampMacro( NumberOfControlPoints, unsigned int, 3, 2000 );
89  itkGetConstMacro( NumberOfControlPoints, unsigned int );
90 
91  itkSetClampMacro( NumberOfLevels, unsigned int, 1, 5 );
92  itkGetConstMacro( NumberOfLevels, unsigned int );
93 
95 
96  void ComputeGridRegion( int numberOfControlPoints,
97  typename TransformType::RegionType::SizeType & regionSize,
98  typename TransformType::SpacingType & regionSpacing,
99  typename TransformType::OriginType & regionOrigin,
100  typename TransformType::DirectionType & regionDirection);
101 
102  void ResampleControlGrid( int newNumberOfControlPoints, ParametersType & newParameters );
103 
104  itkSetMacro( GradientOptimizeOnly, bool );
105  itkGetMacro( GradientOptimizeOnly, bool );
106 protected:
109 
110  typedef InterpolateImageFunction<TImage, double> InterpolatorType;
111  typedef ImageToImageMetric<TImage, TImage> MetricType;
112 
113  void Optimize( MetricType * metric, InterpolatorType * interpolator ) override;
114 
115  virtual void GradientOptimize( MetricType * metric, InterpolatorType * interpolator );
116 
117  virtual void MultiResolutionOptimize( MetricType * metric, InterpolatorType * interpolator );
118 
119  void PrintSelf( std::ostream & os, Indent indent ) const override;
120 
121 private:
122 
123  BSplineImageToImageRegistrationMethod( const Self & ); // Purposely not implemented
124  void operator =( const Self & ); // Purposely not implemented
125 
126  double m_ExpectedDeformationMagnitude;
127 
128  unsigned int m_NumberOfControlPoints;
129 
130  unsigned int m_NumberOfLevels;
131 
132  bool m_GradientOptimizeOnly;
133 
134 };
135 
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkBSplineImageToImageRegistrationMethod.txx"
140 #endif
141 
142 #endif // __ImageToImageRegistrationMethod_h
BSplineTransformPointer GetBSplineTransform() const
itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension)
void Optimize(MetricType *metric, InterpolatorType *interpolator) override
void ComputeGridRegion(int numberOfControlPoints, typename TransformType::RegionType::SizeType &regionSize, typename TransformType::SpacingType &regionSpacing, typename TransformType::OriginType &regionOrigin, typename TransformType::DirectionType &regionDirection)
InterpolateImageFunction< TImage, double > InterpolatorType
itkSetClampMacro(NumberOfControlPoints, unsigned int, 3, 2000)
void PrintSelf(std::ostream &os, Indent indent) const override
Simplified inverse ITK transforms.
virtual void GradientOptimize(MetricType *metric, InterpolatorType *interpolator)
OptimizedImageToImageRegistrationMethod< TImage > Superclass
itkTypeMacro(BSplineImageToImageRegistrationMethod, OptimizedImageToImageRegistrationMethod)
itkGetConstMacro(ExpectedDeformationMagnitude, double)
BSplineDeformableTransform< double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> BSplineTransformType
itkGetMacro(GradientOptimizeOnly, bool)
void ResampleControlGrid(int newNumberOfControlPoints, ParametersType &newParameters)
virtual TransformType * GetTypedTransform()
virtual void MultiResolutionOptimize(MetricType *metric, InterpolatorType *interpolator)
itkSetMacro(ExpectedDeformationMagnitude, double)