Slicer  4.8
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  virtual void GenerateData( void ) ITK_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 );
114  void SetFixedImageSamplesIntensityThreshold( PixelType val );
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:
134 
137 
138  itkSetMacro( FinalMetricValue, double );
139 
140  itkSetMacro( TransformMethodEnum, TransformMethodEnumType );
141 
142  typedef InterpolateImageFunction<TImage, double> InterpolatorType;
143  typedef ImageToImageMetric<TImage, TImage> MetricType;
144 
145  virtual void Optimize( MetricType * metric, InterpolatorType * interpolator );
146 
147  virtual void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
148 
149 private:
150 
151  OptimizedImageToImageRegistrationMethod( const Self & ); // Purposely not implemented
152  void operator =( const Self & ); // Purposely not implemented
153 
154  TransformParametersType m_InitialTransformParameters;
155  TransformParametersType m_InitialTransformFixedParameters;
156 
157  TransformParametersType m_LastTransformParameters;
158 
159  TransformParametersScalesType m_TransformParametersScales;
160 
161  bool m_SampleFromOverlap;
162 
163  bool m_MinimizeMemory;
164 
165  unsigned int m_MaxIterations;
166 
167  bool m_UseEvolutionaryOptimization;
168 
169  unsigned int m_NumberOfSamples;
170 
171  bool m_UseFixedImageSamplesIntensityThreshold;
172  PixelType m_FixedImageSamplesIntensityThreshold;
173 
174  double m_TargetError;
175 
176  int m_RandomNumberSeed;
177 
178  TransformMethodEnumType m_TransformMethodEnum;
179 
180  MetricMethodEnumType m_MetricMethodEnum;
181 
182  InterpolationMethodEnumType m_InterpolationMethodEnum;
183 
184  double m_FinalMetricValue;
185 };
186 
187 }
188 
189 #ifndef ITK_MANUAL_INSTANTIATION
190 #include "itkOptimizedImageToImageRegistrationMethod.txx"
191 #endif
192 
193 #endif
Simplified inverse ITK transforms.
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itkGetConstMacro(InitialTransformParameters, TransformParametersType)
itkTypeMacro(OptimizedImageToImageRegistrationMethod, ImageToImageRegistrationMethod)
Transform< double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType
itkSetMacro(InitialTransformParameters, TransformParametersType)
itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension)
virtual void GenerateData(void) ITK_OVERRIDE
void SetFixedImageSamplesIntensityThreshold(PixelType val)
virtual void Optimize(MetricType *metric, InterpolatorType *interpolator)