ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkMultiResolutionImageRegistrationMethod.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 __itkMultiResolutionImageRegistrationMethod_h
19 #define __itkMultiResolutionImageRegistrationMethod_h
20 
21 #include "itkProcessObject.h"
22 #include "itkImageToImageMetric.h"
25 #include "itkNumericTraits.h"
26 #include "itkDataObjectDecorator.h"
27 
28 namespace itk
29 {
71 template< typename TFixedImage, typename TMovingImage >
73 {
74 public:
80 
82  itkNewMacro(Self);
83 
86 
88  typedef TFixedImage FixedImageType;
89  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
90  typedef typename FixedImageType::RegionType FixedImageRegionType;
91 
93  typedef TMovingImage MovingImageType;
94  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
95 
99 
103 
109 
113 
116 
120 
123 
127 
131 
134 
136  void StartRegistration();
137 
139  void StopRegistration();
140 
142  itkSetConstObjectMacro(FixedImage, FixedImageType);
143  itkGetConstObjectMacro(FixedImage, FixedImageType);
145 
147  itkSetConstObjectMacro(MovingImage, MovingImageType);
148  itkGetConstObjectMacro(MovingImage, MovingImageType);
150 
152  itkSetObjectMacro(Optimizer, OptimizerType);
153  itkGetObjectMacro(Optimizer, OptimizerType);
155 
157  itkSetObjectMacro(Metric, MetricType);
158  itkGetObjectMacro(Metric, MetricType);
160 
162  itkSetMacro(FixedImageRegion, FixedImageRegionType);
163  itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
165 
167  itkSetObjectMacro(Transform, TransformType);
168  itkGetObjectMacro(Transform, TransformType);
170 
172  itkSetObjectMacro(Interpolator, InterpolatorType);
173  itkGetObjectMacro(Interpolator, InterpolatorType);
175 
177  itkSetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
178  itkGetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
180 
182  itkSetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
183  itkGetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
185 
187  void SetSchedules(const ScheduleType & fixedSchedule,
188  const ScheduleType & movingSchedule);
189 
190  itkGetConstMacro(FixedImagePyramidSchedule, ScheduleType);
191  itkGetConstMacro(MovingImagePyramidSchedule, ScheduleType);
192 
194  void SetNumberOfLevels(SizeValueType numberOfLevels);
195 
196  itkGetConstMacro(NumberOfLevels, SizeValueType);
197 
199  itkGetConstMacro(CurrentLevel, SizeValueType);
200 
202  itkSetMacro(InitialTransformParameters, ParametersType);
203  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
205 
209  itkSetMacro(InitialTransformParametersOfNextLevel, ParametersType);
210  itkGetConstReferenceMacro(InitialTransformParametersOfNextLevel, ParametersType);
212 
215  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
216 
218  const TransformOutputType * GetOutput() const;
219 
223  using Superclass::MakeOutput;
224  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
225 
228  unsigned long GetMTime() const;
229 
230 protected:
233  void PrintSelf(std::ostream & os, Indent indent) const;
234 
237  void GenerateData();
238 
243  void Initialize()
244  throw ( ExceptionObject );
245 
247  void PreparePyramids(void);
248 
250  itkSetMacro(CurrentLevel, SizeValueType);
251 private:
252  MultiResolutionImageRegistrationMethod(const Self &); //purposely not
253  // implemented
254  void operator=(const Self &); //purposely not
256 
257  // implemented
258 
259  MetricPointer m_Metric;
260  OptimizerType::Pointer m_Optimizer;
261 
262  MovingImageConstPointer m_MovingImage;
264 
265  TransformPointer m_Transform;
266  InterpolatorPointer m_Interpolator;
267 
268  MovingImagePyramidPointer m_MovingImagePyramid;
269  FixedImagePyramidPointer m_FixedImagePyramid;
270 
271  ParametersType m_InitialTransformParameters;
272  ParametersType m_InitialTransformParametersOfNextLevel;
273  ParametersType m_LastTransformParameters;
274 
275  FixedImageRegionType m_FixedImageRegion;
276  std::vector< FixedImageRegionType > m_FixedImageRegionPyramid;
277 
278  SizeValueType m_NumberOfLevels;
279  SizeValueType m_CurrentLevel;
280 
281  bool m_Stop;
282 
283  ScheduleType m_FixedImagePyramidSchedule;
284  ScheduleType m_MovingImagePyramidSchedule;
285 
286  bool m_ScheduleSpecified;
287  bool m_NumberOfLevelsSpecified;
288 };
289 } // end namespace itk
290 
291 #ifndef ITK_MANUAL_INSTANTIATION
292 #include "itkMultiResolutionImageRegistrationMethod.hxx"
293 #endif
294 
295 #endif
296