ITK  5.4.0
Insight Toolkit
itkMultiResolutionImageRegistrationMethod.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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>
72 class ITK_TEMPLATE_EXPORT MultiResolutionImageRegistrationMethod : public ProcessObject
73 {
74 public:
75  ITK_DISALLOW_COPY_AND_MOVE(MultiResolutionImageRegistrationMethod);
76 
82 
84  itkNewMacro(Self);
85 
87  itkOverrideGetNameOfClassMacro(MultiResolutionImageRegistrationMethod);
88 
90  using FixedImageType = TFixedImage;
93 
95  using MovingImageType = TMovingImage;
97 
101 
105 
111 
115 
118 
122 
125 
129 
133 
136 
138  void
139  StopRegistration();
140 
142  itkSetConstObjectMacro(FixedImage, FixedImageType);
143  itkGetConstObjectMacro(FixedImage, FixedImageType);
147  itkSetConstObjectMacro(MovingImage, MovingImageType);
148  itkGetConstObjectMacro(MovingImage, MovingImageType);
152  itkSetObjectMacro(Optimizer, OptimizerType);
153  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
157  itkSetObjectMacro(Metric, MetricType);
158  itkGetModifiableObjectMacro(Metric, MetricType);
162  itkSetMacro(FixedImageRegion, FixedImageRegionType);
163  itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
167  itkSetObjectMacro(Transform, TransformType);
168  itkGetModifiableObjectMacro(Transform, TransformType);
172  itkSetObjectMacro(Interpolator, InterpolatorType);
173  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
177  itkSetObjectMacro(FixedImagePyramid, FixedImagePyramidType);
178  itkGetModifiableObjectMacro(FixedImagePyramid, FixedImagePyramidType);
182  itkSetObjectMacro(MovingImagePyramid, MovingImagePyramidType);
183  itkGetModifiableObjectMacro(MovingImagePyramid, MovingImagePyramidType);
187  void
188  SetSchedules(const ScheduleType & fixedImagePyramidSchedule, const ScheduleType & movingImagePyramidSchedule);
189 
190  itkGetConstMacro(FixedImagePyramidSchedule, ScheduleType);
191  itkGetConstMacro(MovingImagePyramidSchedule, ScheduleType);
192 
194  void
195  SetNumberOfLevels(SizeValueType numberOfLevels);
196 
197  itkGetConstMacro(NumberOfLevels, SizeValueType);
198 
200  itkGetConstMacro(CurrentLevel, SizeValueType);
201 
203  itkSetMacro(InitialTransformParameters, ParametersType);
204  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
210  itkSetMacro(InitialTransformParametersOfNextLevel, ParametersType);
211  itkGetConstReferenceMacro(InitialTransformParametersOfNextLevel, ParametersType);
216  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
217 
219  const TransformOutputType *
220  GetOutput() const;
221 
225  using Superclass::MakeOutput;
227  MakeOutput(DataObjectPointerArraySizeType output) override;
228 
232  GetMTime() const override;
233 
234 protected:
236  ~MultiResolutionImageRegistrationMethod() override = default;
237  void
238  PrintSelf(std::ostream & os, Indent indent) const override;
239 
242  void
243  GenerateData() override;
244 
249  void
250  Initialize();
251 
253  void
254  PreparePyramids();
255 
257  itkSetMacro(CurrentLevel, SizeValueType);
258 
259 private:
260  MetricPointer m_Metric{};
261  OptimizerType::Pointer m_Optimizer{};
262 
263  MovingImageConstPointer m_MovingImage{};
264  FixedImageConstPointer m_FixedImage{};
265 
266  TransformPointer m_Transform{};
267  InterpolatorPointer m_Interpolator{};
268 
269  MovingImagePyramidPointer m_MovingImagePyramid{};
270  FixedImagePyramidPointer m_FixedImagePyramid{};
271 
272  ParametersType m_InitialTransformParameters{};
273  ParametersType m_InitialTransformParametersOfNextLevel{};
274  ParametersType m_LastTransformParameters{};
275 
276  FixedImageRegionType m_FixedImageRegion{};
277  std::vector<FixedImageRegionType> m_FixedImageRegionPyramid{};
278 
279  SizeValueType m_NumberOfLevels{};
280  SizeValueType m_CurrentLevel{};
281 
282  bool m_Stop{};
283 
284  ScheduleType m_FixedImagePyramidSchedule{};
285  ScheduleType m_MovingImagePyramidSchedule{};
286 
287  bool m_ScheduleSpecified{};
288  bool m_NumberOfLevelsSpecified{};
289 };
290 } // end namespace itk
291 
292 #ifndef ITK_MANUAL_INSTANTIATION
293 # include "itkMultiResolutionImageRegistrationMethod.hxx"
294 #endif
295 
296 #endif
itk::MultiResolutionImageRegistrationMethod::FixedImageType
TFixedImage FixedImageType
Definition: itkMultiResolutionImageRegistrationMethod.h:90
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ImageToImageMetric
Computes similarity between regions of two images.
Definition: itkImageToImageMetric.h:54
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::SingleValuedNonLinearOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearOptimizer.h:35
itkMultiResolutionPyramidImageFilter.h
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::MultiResolutionImageRegistrationMethod::ScheduleType
typename FixedImagePyramidType::ScheduleType ScheduleType
Definition: itkMultiResolutionImageRegistrationMethod.h:124
itk::ImageToImageMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkImageToImageMetric.h:92
itk::MultiResolutionImageRegistrationMethod
Base class for multi-resolution image registration methods.
Definition: itkMultiResolutionImageRegistrationMethod.h:72
itk::Optimizer
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
itk::MultiResolutionImageRegistrationMethod::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:91
itk::MultiResolutionImageRegistrationMethod::MovingImagePyramidPointer
typename MovingImagePyramidType::Pointer MovingImagePyramidPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:128
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:194
itk::MultiResolutionImageRegistrationMethod::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:114
itk::DataObjectDecorator
Decorates any subclass of itkObject with a DataObject API.
Definition: itkDataObjectDecorator.h:66
itk::MultiResolutionImageRegistrationMethod::ParametersType
typename MetricType::TransformParametersType ParametersType
Definition: itkMultiResolutionImageRegistrationMethod.h:132
itk::MultiResolutionImageRegistrationMethod::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:96
itk::MultiResolutionImageRegistrationMethod::MovingImageType
TMovingImage MovingImageType
Definition: itkMultiResolutionImageRegistrationMethod.h:95
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::MultiResolutionImageRegistrationMethod::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:104
itk::MultiResolutionImageRegistrationMethod::MetricPointer
typename MetricType::Pointer MetricPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:100
itkImageToImageMetric.h
itkProcessObject.h
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkDataObjectDecorator.h
itk::MultiResolutionImageRegistrationMethod::FixedImagePyramidPointer
typename FixedImagePyramidType::Pointer FixedImagePyramidPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:121
itk::MultiResolutionImageRegistrationMethod::TransformOutputConstPointer
typename TransformOutputType::ConstPointer TransformOutputConstPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:110
itk::MultiResolutionImageRegistrationMethod::TransformType
typename MetricType::TransformType TransformType
Definition: itkMultiResolutionImageRegistrationMethod.h:103
itk::MultiResolutionImageRegistrationMethod::FixedImageRegionType
typename FixedImageType::RegionType FixedImageRegionType
Definition: itkMultiResolutionImageRegistrationMethod.h:92
itk::MultiResolutionPyramidImageFilter
Framework for creating images in a multi-resolution pyramid.
Definition: itkMultiResolutionPyramidImageFilter.h:109
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::MultiResolutionImageRegistrationMethod::InterpolatorType
typename MetricType::InterpolatorType InterpolatorType
Definition: itkMultiResolutionImageRegistrationMethod.h:113
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itkNumericTraits.h
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
itk::Array2D< unsigned int >
itkSingleValuedNonLinearOptimizer.h
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:45
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::MultiResolutionImageRegistrationMethod::TransformOutputPointer
typename TransformOutputType::Pointer TransformOutputPointer
Definition: itkMultiResolutionImageRegistrationMethod.h:109