ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkPointSetToImageRegistrationMethod.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 itkPointSetToImageRegistrationMethod_h
19 #define itkPointSetToImageRegistrationMethod_h
20 
21 #include "itkProcessObject.h"
22 #include "itkImage.h"
25 #include "itkDataObjectDecorator.h"
26 
27 namespace itk
28 {
66 template< typename TFixedPointSet, typename TMovingImage >
67 class ITK_TEMPLATE_EXPORT PointSetToImageRegistrationMethod : public ProcessObject
68 {
69 public:
75 
77  itkNewMacro(Self);
78 
81 
83  typedef TFixedPointSet FixedPointSetType;
84  typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer;
85 
87  typedef TMovingImage MovingImageType;
88  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
89 
93 
97 
103 
107 
110 
114 
117 
119  itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
120  itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
122 
124  itkSetConstObjectMacro(MovingImage, MovingImageType);
125  itkGetConstObjectMacro(MovingImage, MovingImageType);
127 
129  itkSetObjectMacro(Optimizer, OptimizerType);
130  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
132 
134  itkSetObjectMacro(Metric, MetricType);
135  itkGetModifiableObjectMacro(Metric, MetricType);
137 
139  itkSetObjectMacro(Transform, TransformType);
140  itkGetModifiableObjectMacro(Transform, TransformType);
142 
144  itkSetObjectMacro(Interpolator, InterpolatorType);
145  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
147 
149  virtual void SetInitialTransformParameters(const ParametersType & param);
150 
151  itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
152 
155  itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
156 
158  void Initialize();
159 
161  const TransformOutputType * GetOutput() const;
162 
166  using Superclass::MakeOutput;
167  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
168 
169  virtual ModifiedTimeType GetMTime() const ITK_OVERRIDE;
170 
171 #ifdef ITKV3_COMPATIBILITY
172 
173  // StartRegistration is an old API from before
174  // ImageRegistrationMethod was a subclass of ProcessObject.
175  // Historically, one could call StartRegistration() instead of
176  // calling Update(). However, when called directly by the user, the
177  // inputs to ImageRegistrationMethod may not be up to date. This
178  // may cause an unexpected behavior.
179  //
180  // Since we cannot eliminate StartRegistration for backward
181  // compatibility reasons, we check whether StartRegistration was
182  // called directly or whether Update() (which in turn called
183  // StartRegistration()).
184  void StartRegistration(void) { this->Update(); }
185 #endif
186 
187 protected:
189  virtual ~PointSetToImageRegistrationMethod() ITK_OVERRIDE {}
190  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
191 
192  virtual void GenerateData() ITK_OVERRIDE;
193 
194 private:
195  ITK_DISALLOW_COPY_AND_ASSIGN(PointSetToImageRegistrationMethod);
196 
197  MetricPointer m_Metric;
198  OptimizerType::Pointer m_Optimizer;
199 
200  MovingImageConstPointer m_MovingImage;
201  FixedPointSetConstPointer m_FixedPointSet;
202 
203  TransformPointer m_Transform;
204  InterpolatorPointer m_Interpolator;
205 
206  ParametersType m_InitialTransformParameters;
207  ParametersType m_LastTransformParameters;
208 };
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkPointSetToImageRegistrationMethod.hxx"
213 #endif
214 
215 #endif
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Light weight base class for most itk classes.
TransformOutputType::ConstPointer TransformOutputConstPointer
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...
DataObjectDecorator< TransformType > TransformOutputType
Computes similarity between a point set and an image.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
PointSetToImageMetric< FixedPointSetType, MovingImageType > MetricType
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
Base class for all image interpolaters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for PointSet to Image Registration Methods.