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);
00084
00086 itkSetObjectMacro( Transform, TransformType );
00087
00089 typedef TFixedImage FixedImageType;
00090 typedef TMovingImage MovingImageType;
00091
00092 typedef typename FixedImageType::ConstPointer FixedImagePointer;
00093 typedef typename MovingImageType::ConstPointer MovingImagePointer;
00094
00095
00102 void SetFixedImage( const FixedImageType * image )
00103 {
00104 this->m_FixedImage = image;
00105 itkLegacyBodyMacro( SetFixedImage, 2.2 );
00106 }
00108
00109
00116 void SetMovingImage( const MovingImageType * image )
00117 {
00118 this->m_MovingImage = image;
00119 itkLegacyBodyMacro( SetMovingImage, 2.2 );
00120 }
00122
00123
00125 itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00126
00128 typedef typename TransformType::InputPointType InputPointType;
00129 typedef typename TransformType::OutputVectorType OutputVectorType;
00130 typedef Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType;
00131 typedef std::vector< LandmarkPointType > LandmarkPointContainer;
00132 typedef typename
00133 LandmarkPointContainer::const_iterator PointsContainerConstIterator;
00134 typedef typename TransformType::ParametersType ParametersType;
00135 typedef typename ParametersType::ValueType ParameterValueType;
00136
00137
00138
00140 void SetFixedLandmarks(const LandmarkPointContainer & fixedLandmarks)
00141 {
00142 this->m_FixedLandmarks = fixedLandmarks;
00143 }
00144
00146 void SetMovingLandmarks(const LandmarkPointContainer & movingLandmarks)
00147 {
00148 this->m_MovingLandmarks = movingLandmarks;
00149 }
00150
00151
00153 typedef VersorRigid3DTransform< ParameterValueType >
00154 VersorRigid3DTransformType;
00155 typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;
00156
00158 virtual void InitializeTransform() ;
00159
00160
00161 protected:
00162 LandmarkBasedTransformInitializer();
00163 ~LandmarkBasedTransformInitializer(){};
00164
00165 void PrintSelf(std::ostream &os, Indent indent) const;
00166
00167
00168 typedef enum{
00169 VersorRigid3Dtransform=1,
00170 Rigid2Dtransfrom,
00171 Else
00172 }InputTransformType;
00173
00174 private:
00175 LandmarkBasedTransformInitializer(const Self&);
00176 void operator=(const Self&);
00177
00178 FixedImagePointer m_FixedImage;
00179 MovingImagePointer m_MovingImage;
00180
00181 LandmarkPointContainer m_FixedLandmarks;
00182 LandmarkPointContainer m_MovingLandmarks;
00183
00184 TransformPointer m_Transform;
00185
00186 };
00187
00188
00189 }
00190
00191
00192 #ifndef ITK_MANUAL_INSTANTIATION
00193 #include "itkLandmarkBasedTransformInitializer.txx"
00194 #endif
00195
00196 #endif
00197