ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkLandmarkBasedTransformInitializer.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 __itkLandmarkBasedTransformInitializer_h
19 #define __itkLandmarkBasedTransformInitializer_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
24 #include "itkRigid2DTransform.h"
25 #include "itkAffineTransform.h"
26 #include <vector>
27 #include <iostream>
28 
29 namespace itk
30 {
67 template< typename TTransform,
68  typename TFixedImage,
69  typename TMovingImage >
71  public Object
72 {
73 public:
76  typedef Object Superclass;
79 
81  itkNewMacro(Self);
82 
85 
87  typedef TTransform TransformType;
88  typedef typename TransformType::Pointer TransformPointer;
89 
91  itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
92  itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
94 
96  itkSetObjectMacro(Transform, TransformType);
97 
99  typedef TFixedImage FixedImageType;
100  typedef TMovingImage MovingImageType;
101 
102 
103  typedef typename FixedImageType::ConstPointer FixedImagePointer;
104  typedef typename MovingImageType::ConstPointer MovingImagePointer;
105 
107  itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
108 
110  typedef typename TransformType::InputPointType InputPointType;
111  typedef typename TransformType::OutputVectorType OutputVectorType;
113  typedef std::vector< LandmarkPointType > LandmarkPointContainer;
114  typedef typename LandmarkPointContainer::const_iterator PointsContainerConstIterator;
115  typedef typename TransformType::ParametersType ParametersType;
116  typedef typename ParametersType::ValueType ParameterValueType;
117  typedef std::vector< double > LandmarkWeightType;
118  typedef LandmarkWeightType::const_iterator LandmarkWeightConstIterator;
119 
121  void SetFixedLandmarks(const LandmarkPointContainer & fixedLandmarks)
122  {
123  this->m_FixedLandmarks = fixedLandmarks;
124  }
125 
127  void SetMovingLandmarks(const LandmarkPointContainer & movingLandmarks)
128  {
129  this->m_MovingLandmarks = movingLandmarks;
130  }
131 
135  void SetLandmarkWeight(LandmarkWeightType & landmarkWeight)
136  {
137  this->m_LandmarkWeight= landmarkWeight;
138  }
139 
144 
146  virtual void InitializeTransform();
147 
148 protected:
151 
152  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
153 
154  // Supported Transform types
155  typedef enum {
160 
161 private:
162  LandmarkBasedTransformInitializer(const Self &); //purposely not implemented
163  void operator=(const Self &); //purposely not implemented
164 
165 
167  template <typename TTransform2>
168  void InternalInitializeTransform(TTransform *);
169 
172 
175 
178 
181 
184 
188 
189 }; //class LandmarkBasedTransformInitializer
190 } // namespace itk
191 
192 #ifndef ITK_MANUAL_INSTANTIATION
193 #include "itkLandmarkBasedTransformInitializer.hxx"
194 #endif
195 
196 #endif /* __itkLandmarkBasedTransformInitializer_h */
LandmarkBasedTransformInitializer is a helper class intended to The class computes the transform that...
Light weight base class for most itk classes.
VersorRigid3DTransform of a vector space (e.g. space coordinates)
void InternalInitializeTransform(TTransform *)
Rigid2DTransform< ParameterValueType > Rigid2DTransformType
void SetFixedLandmarks(const LandmarkPointContainer &fixedLandmarks)
void SetLandmarkWeight(LandmarkWeightType &landmarkWeight)
Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType
AffineTransform< ParameterValueType, FixedImageType::ImageDimension > AffineTransformType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
void SetMovingLandmarks(const LandmarkPointContainer &movingLandmarks)
VersorRigid3DTransform< ParameterValueType > VersorRigid3DTransformType
Rigid2DTransform of a vector space (e.g. space coordinates)
LandmarkPointContainer::const_iterator PointsContainerConstIterator
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57
LandmarkWeightType::const_iterator LandmarkWeightConstIterator