Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
itkOptimizedImageToImageRegistrationMethod.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: RigidRegistrator.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 itkOptimizedImageToImageRegistrationMethod_h
19 #define itkOptimizedImageToImageRegistrationMethod_h
20 
21 #include "itkImage.h"
22 
24 
25 namespace itk
26 {
27 
28 template <class TImage>
30  : public ImageToImageRegistrationMethod<TImage>
31 {
32 
33 public:
34 
37  typedef SmartPointer<Self> Pointer;
38  typedef SmartPointer<const Self> ConstPointer;
39 
42 
43  itkNewMacro( Self );
44 
45  //
46  // Typedefs from Superclass
47  //
48  typedef TImage ImageType;
49 
50  typedef typename ImageType::PixelType PixelType;
51 
53 
54  typedef typename TransformType::ParametersType TransformParametersType;
55 
56  typedef typename TransformType::ParametersType TransformParametersScalesType;
57 
58  itkStaticConstMacro( ImageDimension, unsigned int,
59  TImage::ImageDimension );
60 
61  //
62  // Custom Typedefs
63  //
67 
71 
76 
77  //
78  // Methods from Superclass
79  //
80  void GenerateData() override;
81 
82  //
83  // Custom Methods
84  //
85  itkSetMacro( InitialTransformParameters, TransformParametersType );
86  itkGetConstMacro( InitialTransformParameters, TransformParametersType );
87 
88  itkSetMacro( InitialTransformFixedParameters, TransformParametersType );
89  itkGetConstMacro( InitialTransformFixedParameters, TransformParametersType );
90 
91  itkSetMacro( LastTransformParameters, TransformParametersType );
92  itkGetConstMacro( LastTransformParameters, TransformParametersType );
93 
94  itkSetMacro( TransformParametersScales, TransformParametersScalesType );
95  itkGetConstMacro( TransformParametersScales, TransformParametersScalesType );
96 
97  itkSetMacro( SampleFromOverlap, bool );
98  itkGetConstMacro( SampleFromOverlap, bool );
99 
100  itkSetMacro( MinimizeMemory, bool );
101  itkGetConstMacro( MinimizeMemory, bool );
102 
103  itkSetMacro( MaxIterations, unsigned int );
104  itkGetConstMacro( MaxIterations, unsigned int );
105 
106  itkSetMacro( UseEvolutionaryOptimization, bool );
107  itkGetConstMacro( UseEvolutionaryOptimization, bool );
108 
109  itkSetMacro( NumberOfSamples, unsigned int );
110  itkGetConstMacro( NumberOfSamples, unsigned int );
111 
112  itkSetMacro( UseFixedImageSamplesIntensityThreshold, bool );
113  itkGetConstMacro( UseFixedImageSamplesIntensityThreshold, bool );
115 
116  itkGetConstMacro( FixedImageSamplesIntensityThreshold, PixelType );
117 
118  itkSetMacro( TargetError, double );
119  itkGetConstMacro( TargetError, double );
120 
121  itkSetMacro( RandomNumberSeed, int );
122  itkGetConstMacro( RandomNumberSeed, int );
123 
124  itkGetConstMacro( TransformMethodEnum, TransformMethodEnumType );
125 
126  itkSetMacro( MetricMethodEnum, MetricMethodEnumType );
127  itkGetConstMacro( MetricMethodEnum, MetricMethodEnumType );
128 
129  itkSetMacro( InterpolationMethodEnum, InterpolationMethodEnumType );
130  itkGetConstMacro( InterpolationMethodEnum, InterpolationMethodEnumType );
131 
132  itkGetMacro( FinalMetricValue, double );
133 protected:
136 
137  itkSetMacro( FinalMetricValue, double );
138 
139  itkSetMacro( TransformMethodEnum, TransformMethodEnumType );
140 
141  typedef InterpolateImageFunction<TImage, double> InterpolatorType;
142  typedef ImageToImageMetric<TImage, TImage> MetricType;
143 
144  virtual void Optimize( MetricType * metric, InterpolatorType * interpolator );
145 
146  void PrintSelf( std::ostream & os, Indent indent ) const override;
147 
148 private:
149 
150  OptimizedImageToImageRegistrationMethod( const Self & ); // Purposely not implemented
151  void operator =( const Self & ); // Purposely not implemented
152 
153  TransformParametersType m_InitialTransformParameters;
154  TransformParametersType m_InitialTransformFixedParameters;
155 
156  TransformParametersType m_LastTransformParameters;
157 
158  TransformParametersScalesType m_TransformParametersScales;
159 
160  bool m_SampleFromOverlap;
161 
162  bool m_MinimizeMemory;
163 
164  unsigned int m_MaxIterations;
165 
166  bool m_UseEvolutionaryOptimization;
167 
168  unsigned int m_NumberOfSamples;
169 
170  bool m_UseFixedImageSamplesIntensityThreshold;
171  PixelType m_FixedImageSamplesIntensityThreshold;
172 
173  double m_TargetError;
174 
175  int m_RandomNumberSeed;
176 
177  TransformMethodEnumType m_TransformMethodEnum;
178 
179  MetricMethodEnumType m_MetricMethodEnum;
180 
181  InterpolationMethodEnumType m_InterpolationMethodEnum;
182 
183  double m_FinalMetricValue;
184 };
185 
186 }
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkOptimizedImageToImageRegistrationMethod.txx"
190 #endif
191 
192 #endif
Simplified inverse ITK transforms.
itkGetConstMacro(InitialTransformParameters, TransformParametersType)
itkTypeMacro(OptimizedImageToImageRegistrationMethod, ImageToImageRegistrationMethod)
Transform< double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType
itkSetMacro(InitialTransformParameters, TransformParametersType)
itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension)
void PrintSelf(std::ostream &os, Indent indent) const override
void SetFixedImageSamplesIntensityThreshold(PixelType val)
virtual void Optimize(MetricType *metric, InterpolatorType *interpolator)