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
00057 template < class TTransform,
00058 class TFixedImage,
00059 class TMovingImage >
00060 class ITK_EXPORT LandmarkBasedTransformInitializer :
00061 public Object
00062 {
00063 public:
00065 typedef LandmarkBasedTransformInitializer Self;
00066 typedef Object Superclass;
00067 typedef SmartPointer<Self> Pointer;
00068 typedef SmartPointer<const Self> ConstPointer;
00069
00071 itkNewMacro( Self );
00072
00074 itkTypeMacro( LandmarkBasedTransformInitializer, Object );
00075
00077 typedef TTransform TransformType;
00078 typedef typename TransformType::Pointer TransformPointer;
00079
00081 itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
00082 itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
00083
00085 itkSetObjectMacro( Transform, TransformType );
00086
00088 typedef TFixedImage FixedImageType;
00089 typedef TMovingImage MovingImageType;
00090
00091 typedef typename FixedImageType::ConstPointer FixedImagePointer;
00092 typedef typename MovingImageType::ConstPointer MovingImagePointer;
00093
00094
00101 void SetFixedImage( const FixedImageType * image )
00102 {
00103 this->m_FixedImage = image;
00104 itkLegacyBody( SetFixedImage, 2.2 );
00105 }
00106
00107
00114 void SetMovingImage( const MovingImageType * image )
00115 {
00116 this->m_MovingImage = image;
00117 itkLegacyBody( SetMovingImage, 2.2 );
00118 }
00119
00120
00122 itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00123
00125 typedef typename TransformType::InputPointType InputPointType;
00126 typedef typename TransformType::OutputVectorType OutputVectorType;
00127 typedef Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType;
00128 typedef std::vector< LandmarkPointType > LandmarkPointContainer;
00129 typedef typename
00130 LandmarkPointContainer::const_iterator PointsContainerConstIterator;
00131 typedef typename TransformType::ParametersType ParametersType;
00132 typedef typename ParametersType::ValueType ParameterValueType;
00133
00134
00135
00137 void SetFixedLandmarks(LandmarkPointContainer & fixedLandmarks)
00138 {
00139 this->m_FixedLandmarks = fixedLandmarks;
00140 }
00141
00143 void SetMovingLandmarks(LandmarkPointContainer & movingLandmarks)
00144 {
00145 this->m_MovingLandmarks = movingLandmarks;
00146 }
00147
00148
00150 typedef VersorRigid3DTransform< ParameterValueType >
00151 VersorRigid3DTransformType;
00152 typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;
00153
00155 virtual void InitializeTransform() ;
00156
00157
00158 protected:
00159 LandmarkBasedTransformInitializer();
00160 ~LandmarkBasedTransformInitializer(){};
00161
00162 void PrintSelf(std::ostream &os, Indent indent) const;
00163
00164
00165 typedef enum{
00166 VersorRigid3Dtransform=1,
00167 Rigid2Dtransfrom,
00168 Else
00169 }InputTransformType;
00170
00171 private:
00172 LandmarkBasedTransformInitializer(const Self&);
00173 void operator=(const Self&);
00174
00175 FixedImagePointer m_FixedImage;
00176 MovingImagePointer m_MovingImage;
00177
00178 LandmarkPointContainer m_FixedLandmarks;
00179 LandmarkPointContainer m_MovingLandmarks;
00180
00181 TransformPointer m_Transform;
00182
00183 };
00184
00185
00186 }
00187
00188
00189 #ifndef ITK_MANUAL_INSTANTIATION
00190 #include "itkLandmarkBasedTransformInitializer.txx"
00191 #endif
00192
00193 #endif