ITK  4.8.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 "itkBSplineTransform.h"
27 #include "itkPoint.h"
28 #include "itkPointSet.h"
31 #include <vector>
32 
33 namespace itk
34 {
79 template< typename TTransform,
80  typename TFixedImage,
81  typename TMovingImage >
83  public Object
84 {
85 public:
88  typedef Object Superclass;
91 
93  itkNewMacro(Self);
94 
97 
99  typedef TTransform TransformType;
100  typedef typename TransformType::Pointer TransformPointer;
101 
103  itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
104  itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
106 
108  itkSetObjectMacro(Transform, TransformType);
109 
111  typedef TFixedImage FixedImageType;
112  typedef TMovingImage MovingImageType;
113 
115  itkSetObjectMacro(ReferenceImage, FixedImageType);
116 
118  itkSetMacro(BSplineNumberOfControlPoints, unsigned int);
119 
120  typedef typename FixedImageType::ConstPointer FixedImagePointer;
121  typedef typename MovingImageType::ConstPointer MovingImagePointer;
122 
124  itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension);
125 
127  typedef typename TransformType::InputPointType InputPointType;
128  typedef typename TransformType::OutputVectorType OutputVectorType;
129 
131  typedef std::vector< LandmarkPointType > LandmarkPointContainer;
132  typedef typename LandmarkPointContainer::const_iterator PointsContainerConstIterator;
133 
134  typedef typename TransformType::ParametersType ParametersType;
135  typedef typename ParametersType::ValueType ParametersValueType;
136  typedef std::vector< double > LandmarkWeightType;
137  typedef LandmarkWeightType::const_iterator LandmarkWeightConstIterator;
138 
140  void SetFixedLandmarks(const LandmarkPointContainer & fixedLandmarks)
141  {
142  this->m_FixedLandmarks = fixedLandmarks;
143  }
144 
146  void SetMovingLandmarks(const LandmarkPointContainer & movingLandmarks)
147  {
148  this->m_MovingLandmarks = movingLandmarks;
149  }
150 
154  void SetLandmarkWeight(LandmarkWeightType & landmarkWeight)
155  {
156  this->m_LandmarkWeight= landmarkWeight;
157  }
158 
163 
164  const static unsigned int SplineOrder = 3;
166  FixedImageType::ImageDimension,
168 
170  virtual void InitializeTransform();
171 
172 protected:
175 
176  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
177 
178 private:
179  LandmarkBasedTransformInitializer(const Self &); //purposely not implemented
180  void operator=(const Self &); //purposely not implemented
181 
182 
184  template <typename TTransform2>
185  void InternalInitializeTransform(TTransform *);
186 
189 
192 
195 
198 
206 
207 }; //class LandmarkBasedTransformInitializer
208 } // namespace itk
209 
210 #ifndef ITK_MANUAL_INSTANTIATION
211 #include "itkLandmarkBasedTransformInitializer.hxx"
212 #endif
213 
214 #endif /* itkLandmarkBasedTransformInitializer_h */
Light weight base class for most itk classes.
VersorRigid3DTransform of a vector space (e.g. space coordinates)
void InternalInitializeTransform(TTransform *)
Deformable transform using a BSpline representation.
Rigid2DTransform< ParametersValueType > Rigid2DTransformType
AffineTransform< ParametersValueType, FixedImageType::ImageDimension > AffineTransformType
void SetFixedLandmarks(const LandmarkPointContainer &fixedLandmarks)
void SetLandmarkWeight(LandmarkWeightType &landmarkWeight)
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void SetMovingLandmarks(const LandmarkPointContainer &movingLandmarks)
BSplineTransform< ParametersValueType, FixedImageType::ImageDimension, SplineOrder > BSplineTransformType
Rigid2DTransform of a vector space (e.g. space coordinates)
VersorRigid3DTransform< ParametersValueType > VersorRigid3DTransformType
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
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51