00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkLandmarkBasedTransformInitializer_h
00019 #define __itkLandmarkBasedTransformInitializer_h
00020
00021 #include "itkObject.h"
00022 #include "itkObjectFactory.h"
00023 #include "itkVersorRigid3DTransform.h"
00024 #include "itkRigid2DTransform.h"
00025 #include <vector>
00026 #include <iostream>
00027
00028 namespace itk
00029 {
00030
00058 template < class TTransform,
00059 class TFixedImage,
00060 class TMovingImage >
00061 class ITK_EXPORT LandmarkBasedTransformInitializer :
00062 public Object
00063 {
00064 public:
00066 typedef LandmarkBasedTransformInitializer Self;
00067 typedef Object Superclass;
00068 typedef SmartPointer<Self> Pointer;
00069 typedef SmartPointer<const Self> ConstPointer;
00070
00072 itkNewMacro( Self );
00073
00075 itkTypeMacro( LandmarkBasedTransformInitializer, Object );
00076
00078 typedef TTransform TransformType;
00079 typedef typename TransformType::Pointer TransformPointer;
00080
00082 itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
00083 itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
00085
00087 itkSetObjectMacro( Transform, TransformType );
00088
00090 typedef TFixedImage FixedImageType;
00091 typedef TMovingImage MovingImageType;
00092
00093 typedef typename FixedImageType::ConstPointer FixedImagePointer;
00094 typedef typename MovingImageType::ConstPointer MovingImagePointer;
00095
00096
00103 void SetFixedImage( const FixedImageType * image )
00104 {
00105 this->m_FixedImage = image;
00106 itkLegacyBodyMacro( SetFixedImage, 2.2 );
00107 }
00109
00110
00117 void SetMovingImage( const MovingImageType * image )
00118 {
00119 this->m_MovingImage = image;
00120 itkLegacyBodyMacro( SetMovingImage, 2.2 );
00121 }
00123
00124
00126 itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00127
00129 typedef typename TransformType::InputPointType InputPointType;
00130 typedef typename TransformType::OutputVectorType OutputVectorType;
00131 typedef Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType;
00132 typedef std::vector< LandmarkPointType > LandmarkPointContainer;
00133 typedef typename
00134 LandmarkPointContainer::const_iterator PointsContainerConstIterator;
00135 typedef typename TransformType::ParametersType ParametersType;
00136 typedef typename ParametersType::ValueType ParameterValueType;
00137
00138
00139
00141 void SetFixedLandmarks(const LandmarkPointContainer & fixedLandmarks)
00142 {
00143 this->m_FixedLandmarks = fixedLandmarks;
00144 }
00145
00147 void SetMovingLandmarks(const LandmarkPointContainer & movingLandmarks)
00148 {
00149 this->m_MovingLandmarks = movingLandmarks;
00150 }
00151
00152
00154 typedef VersorRigid3DTransform< ParameterValueType >
00155 VersorRigid3DTransformType;
00156 typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;
00157
00159 virtual void InitializeTransform();
00160
00161
00162 protected:
00163 LandmarkBasedTransformInitializer();
00164 ~LandmarkBasedTransformInitializer(){};
00165
00166 void PrintSelf(std::ostream &os, Indent indent) const;
00167
00168
00169 typedef enum{
00170 VersorRigid3Dtransform=1,
00171 Rigid2Dtransfrom,
00172 Else
00173 }InputTransformType;
00174
00175 private:
00176 LandmarkBasedTransformInitializer(const Self&);
00177 void operator=(const Self&);
00178
00179 FixedImagePointer m_FixedImage;
00180 MovingImagePointer m_MovingImage;
00181
00182 LandmarkPointContainer m_FixedLandmarks;
00183 LandmarkPointContainer m_MovingLandmarks;
00184
00185 TransformPointer m_Transform;
00186
00187 };
00188
00189
00190 }
00191
00192
00193 #ifndef ITK_MANUAL_INSTANTIATION
00194 #include "itkLandmarkBasedTransformInitializer.txx"
00195 #endif
00196
00197 #endif
00198