ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkImageToSpatialObjectRegistrationMethod.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 itkImageToSpatialObjectRegistrationMethod_h
19 #define itkImageToSpatialObjectRegistrationMethod_h
20 
21 #include "itkProcessObject.h"
22 #include "itkImage.h"
25 #include "itkDataObjectDecorator.h"
26 
27 namespace itk
28 {
84 template< typename TFixedImage, typename TMovingSpatialObject >
85 class ITK_TEMPLATE_EXPORT ImageToSpatialObjectRegistrationMethod : public ProcessObject
86 {
87 public:
93 
95  itkNewMacro(Self);
96 
99 
101  typedef TFixedImage FixedImageType;
102  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
103 
105  typedef TMovingSpatialObject MovingSpatialObjectType;
106  typedef typename MovingSpatialObjectType::ConstPointer
108 
113 
117 
123 
127 
130 
134 
137 
139  itkSetConstObjectMacro(FixedImage, FixedImageType);
140  itkGetConstObjectMacro(FixedImage, FixedImageType);
142 
144  itkSetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
145  itkGetConstObjectMacro(MovingSpatialObject, MovingSpatialObjectType);
147 
149  itkSetObjectMacro(Optimizer, OptimizerType);
150  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
152 
154  itkSetObjectMacro(Metric, MetricType);
155  itkGetModifiableObjectMacro(Metric, MetricType);
157 
159  itkSetObjectMacro(Transform, TransformType);
160  itkGetModifiableObjectMacro(Transform, TransformType);
162 
164  itkSetObjectMacro(Interpolator, InterpolatorType);
165  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
167 
169  itkSetMacro(InitialTransformParameters, ParametersType);
170  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
172 
175  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
176 
178  const TransformOutputType * GetOutput() const;
179 
183  using Superclass::MakeOutput;
184  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
185 
188  virtual ModifiedTimeType GetMTime() const ITK_OVERRIDE;
189 
190 #ifdef ITKV3_COMPATIBILITY
191  // StartRegistration is an old API from before
192  // the RegistrationMethod was a subclass of ProcessObject.
193  // Historically, one could call StartRegistration() instead of
194  // calling Update(). However, when called directly by the user, the
195  // inputs to the RegistrationMethod may not be up to date. This
196  // may cause an unexpected behavior.
197  //
198  // Since we cannot eliminate StartRegistration for ITKv3 backward
199  // compatibility reasons, we check whether StartRegistration was
200  // called directly or whether Update() (which in turn called
201  // StartRegistration()).
202  void StartRegistration(void) { this->Update(); }
203 #endif
204 
205 protected:
207  virtual ~ImageToSpatialObjectRegistrationMethod() ITK_OVERRIDE {}
208  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
209 
212  virtual void GenerateData() ITK_OVERRIDE;
213 
215  void Initialize();
216 
217  ParametersType m_InitialTransformParameters;
218  ParametersType m_LastTransformParameters;
219 
220 private:
221  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToSpatialObjectRegistrationMethod);
222 
223  MetricPointer m_Metric;
224  OptimizerType::Pointer m_Optimizer;
225 
226  MovingSpatialObjectConstPointer m_MovingSpatialObject;
228 
229  TransformPointer m_Transform;
230  InterpolatorPointer m_Interpolator;
231 };
232 } // end namespace itk
233 
234 #ifndef ITK_MANUAL_INSTANTIATION
235 #include "itkImageToSpatialObjectRegistrationMethod.hxx"
236 #endif
237 
238 #endif
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
ImageToSpatialObjectMetric< FixedImageType, MovingSpatialObjectType > MetricType
Computes similarity between a moving spatial obejct and an Image to be registered.
Light weight base class for most itk classes.
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
This class is a base for the Optimization methods that optimize a single valued function.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
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.
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
Linearly interpolate an image at specified positions.
Control indentation during Print() invocation.
Definition: itkIndent.h:49