ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkImageRegistrationMethod.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 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:
78 
80  itkNewMacro(Self);
81 
84 
86  typedef TFixedImage FixedImageType;
87  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
88 
90  typedef TMovingImage MovingImageType;
91  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
92 
97 
101 
107 
111 
114 
118 
121 
123  void SetFixedImage(const FixedImageType *fixedImage);
124  itkGetConstObjectMacro(FixedImage, FixedImageType);
126 
128  void SetMovingImage(const MovingImageType *movingImage);
129  itkGetConstObjectMacro(MovingImage, MovingImageType);
131 
133  itkSetObjectMacro(Optimizer, OptimizerType);
134  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
136 
138  itkSetObjectMacro(Metric, MetricType);
139  itkGetModifiableObjectMacro(Metric, MetricType);
141 
143  itkSetObjectMacro(Transform, TransformType);
144  itkGetModifiableObjectMacro(Transform, TransformType);
146 
148  itkSetObjectMacro(Interpolator, InterpolatorType);
149  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
151 
153  virtual void SetInitialTransformParameters(const ParametersType & param);
154 
155  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
156 
159  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
160 
168  void SetFixedImageRegion(const FixedImageRegionType & region);
169 
174  itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
175 
178  itkGetConstMacro(FixedImageRegionDefined, bool);
179 
184  itkSetMacro(FixedImageRegionDefined, bool);
185 
187  virtual void Initialize();
188 
190  const TransformOutputType * GetOutput() const;
191 
195  using Superclass::MakeOutput;
196  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
197 
200  virtual ModifiedTimeType GetMTime() const ITK_OVERRIDE;
201 
202 #ifdef ITKV3_COMPATIBILITY
203 
218  void StartRegistration(void) { this->Update(); }
219 #endif
220 
221 protected:
223  virtual ~ImageRegistrationMethod() ITK_OVERRIDE {}
224  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
227  virtual void GenerateData() ITK_OVERRIDE;
228 
230  itkSetMacro(LastTransformParameters, ParametersType);
231 
232  /* Start the Optimization */
233  void StartOptimization();
234 
235 private:
236  ITK_DISALLOW_COPY_AND_ASSIGN(ImageRegistrationMethod);
237 
238  MetricPointer m_Metric;
239  OptimizerType::Pointer m_Optimizer;
240 
241  MovingImageConstPointer m_MovingImage;
243 
244  TransformPointer m_Transform;
245  InterpolatorPointer m_Interpolator;
246 
247  ParametersType m_InitialTransformParameters;
248  ParametersType m_LastTransformParameters;
249 
250  bool m_FixedImageRegionDefined;
251  FixedImageRegionType m_FixedImageRegion;
252 };
253 } // end namespace itk
254 
255 #ifndef ITK_MANUAL_INSTANTIATION
256 #include "itkImageRegistrationMethod.hxx"
257 #endif
258 
259 #endif
FixedImageType::ConstPointer FixedImageConstPointer
Light weight base class for most itk classes.
MetricType::FixedImageRegionType FixedImageRegionType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
This class is a base for the Optimization methods that optimize a single valued function.
TransformOutputType::ConstPointer TransformOutputConstPointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObjectDecorator< TransformType > TransformOutputType
ImageToImageMetric< FixedImageType, MovingImageType > MetricType
TransformOutputType::Pointer TransformOutputPointer
MetricType::TransformType TransformType
Base class for Image Registration Methods.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Class to hold and manage different parameter types used during optimization.
Decorates any subclass of itkObject with a DataObject API.
MovingImageType::ConstPointer MovingImageConstPointer
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Base class for all image interpolaters.
SingleValuedNonLinearOptimizer OptimizerType
MetricType::TransformParametersType ParametersType
MetricType::InterpolatorType InterpolatorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InterpolatorType::Pointer InterpolatorPointer
Computes similarity between regions of two images.
SmartPointer< const Self > ConstPointer
FixedImageType::RegionType FixedImageRegionType