ITK  6.0.0
Insight Toolkit
itkImageRegistrationMethod.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 itkImageRegistrationMethod_h
19 #define itkImageRegistrationMethod_h
20 
21 #include "itkProcessObject.h"
22 #include "itkImage.h"
23 #include "itkImageToImageMetric.h"
25 #include "itkDataObjectDecorator.h"
26 
27 namespace itk
28 {
69 template <typename TFixedImage, typename TMovingImage>
70 class ITK_TEMPLATE_EXPORT ImageRegistrationMethod : public ProcessObject
71 {
72 public:
73  ITK_DISALLOW_COPY_AND_MOVE(ImageRegistrationMethod);
74 
80 
82  itkNewMacro(Self);
83 
85  itkOverrideGetNameOfClassMacro(ImageRegistrationMethod);
86 
88  using FixedImageType = TFixedImage;
90 
92  using MovingImageType = TMovingImage;
94 
99 
103 
109 
113 
116 
120 
123 
125  void
126  SetFixedImage(const FixedImageType * fixedImage);
127  itkGetConstObjectMacro(FixedImage, FixedImageType);
131  void
132  SetMovingImage(const MovingImageType * movingImage);
133  itkGetConstObjectMacro(MovingImage, MovingImageType);
137  itkSetObjectMacro(Optimizer, OptimizerType);
138  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
142  itkSetObjectMacro(Metric, MetricType);
143  itkGetModifiableObjectMacro(Metric, MetricType);
147  itkSetObjectMacro(Transform, TransformType);
148  itkGetModifiableObjectMacro(Transform, TransformType);
152  itkSetObjectMacro(Interpolator, InterpolatorType);
153  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
157  virtual void
158  SetInitialTransformParameters(const ParametersType & param);
159 
160  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
161 
164  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
165 
173  void
174  SetFixedImageRegion(const FixedImageRegionType & region);
175 
180  itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
181 
184  itkGetConstMacro(FixedImageRegionDefined, bool);
185 
190  itkSetMacro(FixedImageRegionDefined, bool);
191 
193  virtual void
194  Initialize();
195 
197  const TransformOutputType *
198  GetOutput() const;
199 
203  using Superclass::MakeOutput;
205  MakeOutput(DataObjectPointerArraySizeType output) override;
206 
210  GetMTime() const override;
211 
212 protected:
214  ~ImageRegistrationMethod() override = default;
215  void
216  PrintSelf(std::ostream & os, Indent indent) const override;
219  void
220  GenerateData() override;
221 
223  itkSetMacro(LastTransformParameters, ParametersType);
224 
226  void
227  StartOptimization();
228 
229 private:
230  MetricPointer m_Metric{};
231  OptimizerType::Pointer m_Optimizer{};
232 
233  MovingImageConstPointer m_MovingImage{};
234  FixedImageConstPointer m_FixedImage{};
235 
236  TransformPointer m_Transform{};
237  InterpolatorPointer m_Interpolator{};
238 
239  ParametersType m_InitialTransformParameters{};
240  ParametersType m_LastTransformParameters{};
241 
242  bool m_FixedImageRegionDefined{};
243  FixedImageRegionType m_FixedImageRegion{};
244 };
245 } // end namespace itk
246 
247 #ifndef ITK_MANUAL_INSTANTIATION
248 # include "itkImageRegistrationMethod.hxx"
249 #endif
250 
251 #endif
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
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:105
itk::ImageRegistrationMethod::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkImageRegistrationMethod.h:93
itk::ImageToImageMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkImageToImageMetric.h:92
itk::ImageRegistrationMethod::TransformOutputPointer
typename TransformOutputType::Pointer TransformOutputPointer
Definition: itkImageRegistrationMethod.h:107
itk::Optimizer
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
itk::ImageRegistrationMethod::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkImageRegistrationMethod.h:89
itkImage.h
itk::ImageRegistrationMethod
Base class for Image Registration Methods.
Definition: itkImageRegistrationMethod.h:70
itk::ImageRegistrationMethod::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkImageRegistrationMethod.h:112
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageRegistrationMethod::MetricPointer
typename MetricType::Pointer MetricPointer
Definition: itkImageRegistrationMethod.h:97
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:194
itk::DataObjectDecorator
Decorates any subclass of itkObject with a DataObject API.
Definition: itkDataObjectDecorator.h:66
itk::ImageRegistrationMethod::TransformOutputConstPointer
typename TransformOutputType::ConstPointer TransformOutputConstPointer
Definition: itkImageRegistrationMethod.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkImageToImageMetric.h
itkProcessObject.h
itk::ImageRegistrationMethod::TransformType
typename MetricType::TransformType TransformType
Definition: itkImageRegistrationMethod.h:101
itkDataObjectDecorator.h
itk::ImageRegistrationMethod::FixedImageType
TFixedImage FixedImageType
Definition: itkImageRegistrationMethod.h:88
itk::ImageRegistrationMethod::FixedImageRegionType
typename MetricType::FixedImageRegionType FixedImageRegionType
Definition: itkImageRegistrationMethod.h:98
itk::ImageRegistrationMethod::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkImageRegistrationMethod.h:102
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::ImageRegistrationMethod::InterpolatorType
typename MetricType::InterpolatorType InterpolatorType
Definition: itkImageRegistrationMethod.h:111
itk::ImageRegistrationMethod::MovingImageType
TMovingImage MovingImageType
Definition: itkImageRegistrationMethod.h:92
itk::ImageRegistrationMethod::ParametersType
typename MetricType::TransformParametersType ParametersType
Definition: itkImageRegistrationMethod.h:119
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
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::ImageToImageMetric::FixedImageRegionType
typename FixedImageType::RegionType FixedImageRegionType
Definition: itkImageToImageMetric.h:80