ITK  4.6.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 StopRegistration();
137 
139  itkSetConstObjectMacro(FixedImage, FixedImageType);
140  itkGetConstObjectMacro(FixedImage, FixedImageType);
142 
144  itkSetConstObjectMacro(MovingImage, MovingImageType);
145  itkGetConstObjectMacro(MovingImage, MovingImageType);
147 
149  itkSetObjectMacro(Optimizer, OptimizerType);
150  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
152 
154  itkSetObjectMacro(Metric, MetricType);
155  itkGetModifiableObjectMacro(Metric, MetricType);
157 
159  itkSetMacro(FixedImageRegion, FixedImageRegionType);
160  itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
162 
164  itkSetObjectMacro(Transform, TransformType);
165  itkGetModifiableObjectMacro(Transform, TransformType);
167 
169  itkSetObjectMacro(Interpolator, InterpolatorType);
170  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
172 
174  itkSetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
175  itkGetModifiableObjectMacro(FixedImagePyramid, FixedImagePyramidType);
177 
179  itkSetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
180  itkGetModifiableObjectMacro(MovingImagePyramid, MovingImagePyramidType);
182 
184  void SetSchedules(const ScheduleType & fixedSchedule,
185  const ScheduleType & movingSchedule);
186 
187  itkGetConstMacro(FixedImagePyramidSchedule, ScheduleType);
188  itkGetConstMacro(MovingImagePyramidSchedule, ScheduleType);
189 
191  void SetNumberOfLevels(SizeValueType numberOfLevels);
192 
193  itkGetConstMacro(NumberOfLevels, SizeValueType);
194 
196  itkGetConstMacro(CurrentLevel, SizeValueType);
197 
199  itkSetMacro(InitialTransformParameters, ParametersType);
200  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
202 
206  itkSetMacro(InitialTransformParametersOfNextLevel, ParametersType);
207  itkGetConstReferenceMacro(InitialTransformParametersOfNextLevel, ParametersType);
209 
212  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
213 
215  const TransformOutputType * GetOutput() const;
216 
222 
225  virtual ModifiedTimeType GetMTime() const ITK_OVERRIDE;
226 
227 #ifdef ITKV3_COMPATIBILITY
228  // StartRegistration is an old API from before
229  // this RegistrationMethod was a subclass of ProcessObject.
230  // Historically, one could call StartRegistration() instead of
231  // calling Update(). However, when called directly by the user, the
232  // inputs to the RegistrationMethod may not be up to date. This
233  // may cause an unexpected behavior.
234  //
235  // Since we cannot eliminate StartRegistration for backward
236  // compatibility reasons, we check whether StartRegistration was
237  // called directly or whether Update() (which in turn called
238  // StartRegistration()).
239  void StartRegistration(void) { this->Update(); }
240 #endif
241 
242 protected:
245  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
246 
249  virtual void GenerateData() ITK_OVERRIDE;
250 
255  void Initialize()
256  throw ( ExceptionObject );
257 
259  void PreparePyramids(void);
260 
262  itkSetMacro(CurrentLevel, SizeValueType);
263 
264 private:
265  MultiResolutionImageRegistrationMethod(const Self &); //purposely not
266  // implemented
267  void operator=(const Self &); //purposely not
268 
269  // implemented
270 
273 
276 
279 
282 
286 
289 
290  SizeValueType m_NumberOfLevels;
291  SizeValueType m_CurrentLevel;
292 
293  bool m_Stop;
294 
297 
300 };
301 } // end namespace itk
302 
303 #ifndef ITK_MANUAL_INSTANTIATION
304 #include "itkMultiResolutionImageRegistrationMethod.hxx"
305 #endif
306 
307 #endif
virtual void Update()
virtual void GenerateData() ITK_OVERRIDE
Light weight base class for most itk classes.
ImageToImageMetric< FixedImageType, MovingImageType > MetricType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
This class is a base for the Optimization methods that optimize a single valued function.
MultiResolutionPyramidImageFilter< MovingImageType, MovingImageType > MovingImagePyramidType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
const TransformOutputType * GetOutput() const
Framework for creating images in a multi-resolution pyramid.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
void SetSchedules(const ScheduleType &fixedSchedule, const ScheduleType &movingSchedule)
MultiResolutionPyramidImageFilter< FixedImageType, FixedImageType > FixedImagePyramidType
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Decorates any subclass of itkObject with a DataObject API.
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
Standard exception handling object.
Generic representation for an optimization method.
Definition: itkOptimizer.h:37
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
void SetNumberOfLevels(SizeValueType numberOfLevels)
Base class for multi-resolution image registration methods.
Base class for all image interpolaters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Computes similarity between regions of two images.
TransformType::ParametersType TransformParametersType
virtual ModifiedTimeType GetMTime() const ITK_OVERRIDE