ITK  4.12.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;
85 
87  typedef TMovingImage MovingImageType;
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  throw ( ExceptionObject );
160 
162  const TransformOutputType * GetOutput() const;
163 
167  using Superclass::MakeOutput;
168  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
169 
170  virtual ModifiedTimeType GetMTime() const ITK_OVERRIDE;
171 
172 #ifdef ITKV3_COMPATIBILITY
173 
174  // StartRegistration is an old API from before
175  // ImageRegistrationMethod was a subclass of ProcessObject.
176  // Historically, one could call StartRegistration() instead of
177  // calling Update(). However, when called directly by the user, the
178  // inputs to ImageRegistrationMethod may not be up to date. This
179  // may cause an unexpected behavior.
180  //
181  // Since we cannot eliminate StartRegistration for backward
182  // compatibility reasons, we check whether StartRegistration was
183  // called directly or whether Update() (which in turn called
184  // StartRegistration()).
185  void StartRegistration(void) { this->Update(); }
186 #endif
187 
188 protected:
191  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
192 
193  virtual void GenerateData() ITK_OVERRIDE;
194 
195 private:
196  ITK_DISALLOW_COPY_AND_ASSIGN(PointSetToImageRegistrationMethod);
197 
198  MetricPointer m_Metric;
199  OptimizerType::Pointer m_Optimizer;
200 
201  MovingImageConstPointer m_MovingImage;
202  FixedPointSetConstPointer m_FixedPointSet;
203 
204  TransformPointer m_Transform;
205  InterpolatorPointer m_Interpolator;
206 
207  ParametersType m_InitialTransformParameters;
208  ParametersType m_LastTransformParameters;
209 };
210 } // end namespace itk
211 
212 #ifndef ITK_MANUAL_INSTANTIATION
213 #include "itkPointSetToImageRegistrationMethod.hxx"
214 #endif
215 
216 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Light weight base class for most itk classes.
virtual void Initialize()
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...
DataObject::Pointer DataObjectPointer
SmartPointer< Self > Pointer
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.
SmartPointer< const Self > ConstPointer
Standard exception handling object.
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
Base class for all image interpolaters.
virtual void Update()
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for PointSet to Image Registration Methods.