Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __elxSplineKernelTransform_H_
00016 #define __elxSplineKernelTransform_H_
00017
00018 #include "itkKernelTransform2.h"
00019 #include "itkElasticBodySplineKernelTransform2.h"
00020 #include "itkElasticBodyReciprocalSplineKernelTransform2.h"
00021 #include "itkThinPlateSplineKernelTransform2.h"
00022 #include "itkThinPlateR2LogRSplineKernelTransform2.h"
00023 #include "itkVolumeSplineKernelTransform2.h"
00024 #include "elxIncludes.h"
00025
00026 namespace elastix
00027 {
00028 using namespace itk;
00029
00112 template < class TElastix >
00113 class SplineKernelTransform : public AdvancedCombinationTransform<
00114 ITK_TYPENAME elx::TransformBase<TElastix>::CoordRepType,
00115 elx::TransformBase<TElastix>::FixedImageDimension > ,
00116 public elx::TransformBase<TElastix>
00117 {
00118 public:
00119
00121 typedef SplineKernelTransform Self;
00122 typedef AdvancedCombinationTransform<
00123 typename elx::TransformBase<TElastix>::CoordRepType,
00124 elx::TransformBase<TElastix>::FixedImageDimension > Superclass1;
00125 typedef elx::TransformBase<TElastix> Superclass2;
00126
00130 typedef KernelTransform2<
00131 typename elx::TransformBase<TElastix>::CoordRepType,
00132 elx::TransformBase<TElastix>::FixedImageDimension > KernelTransformType;
00133 typedef SmartPointer<Self> Pointer;
00134 typedef SmartPointer<const Self> ConstPointer;
00135
00137 itkNewMacro( Self );
00138
00140 itkTypeMacro( SplineKernelTransform, AdvancedCombinationTransform );
00141
00146 elxClassNameMacro( "SplineKernelTransform" );
00147
00149 itkStaticConstMacro( SpaceDimension, unsigned int, Superclass2::FixedImageDimension );
00150
00152 typedef typename Superclass1::ScalarType ScalarType;
00153 typedef typename Superclass1::ParametersType ParametersType;
00154 typedef typename Superclass1::JacobianType JacobianType;
00155 typedef typename Superclass1::InputVectorType InputVectorType;
00156 typedef typename Superclass1::OutputVectorType OutputVectorType;
00157 typedef typename Superclass1::InputCovariantVectorType InputCovariantVectorType;
00158 typedef typename Superclass1::OutputCovariantVectorType OutputCovariantVectorType;
00159 typedef typename Superclass1::InputVnlVectorType InputVnlVectorType;
00160 typedef typename Superclass1::OutputVnlVectorType OutputVnlVectorType;
00161 typedef typename Superclass1::InputPointType InputPointType;
00162 typedef typename Superclass1::OutputPointType OutputPointType;
00163
00165 typedef typename Superclass2::ElastixType ElastixType;
00166 typedef typename Superclass2::ElastixPointer ElastixPointer;
00167 typedef typename Superclass2::ConfigurationType ConfigurationType;
00168 typedef typename Superclass2::ConfigurationPointer ConfigurationPointer;
00169 typedef typename Superclass2::RegistrationType RegistrationType;
00170 typedef typename Superclass2::RegistrationPointer RegistrationPointer;
00171 typedef typename Superclass2::CoordRepType CoordRepType;
00172 typedef typename Superclass2::FixedImageType FixedImageType;
00173 typedef typename Superclass2::MovingImageType MovingImageType;
00174 typedef typename Superclass2::ITKBaseType ITKBaseType;
00175 typedef typename Superclass2::CombinationTransformType CombinationTransformType;
00176
00178 typedef typename KernelTransformType::Pointer KernelTransformPointer;
00179 typedef typename KernelTransformType::PointSetType PointSetType;
00180 typedef typename PointSetType::Pointer PointSetPointer;
00181
00186 virtual int BeforeAll( void );
00187
00194 virtual void BeforeRegistration( void );
00195
00197 virtual void ReadFromFile( void );
00198
00200 virtual void WriteToFile( const ParametersType & param ) const;
00201
00202 protected:
00203
00205 SplineKernelTransform();
00207 virtual ~SplineKernelTransform() {};
00208
00209 typedef ThinPlateSplineKernelTransform2<
00210 CoordRepType, itkGetStaticConstMacro(SpaceDimension) > TPKernelTransformType;
00211 typedef ThinPlateR2LogRSplineKernelTransform2<
00212 CoordRepType, itkGetStaticConstMacro(SpaceDimension) > TPRKernelTransformType;
00213 typedef VolumeSplineKernelTransform2<
00214 CoordRepType, itkGetStaticConstMacro(SpaceDimension) > VKernelTransformType;
00215 typedef ElasticBodySplineKernelTransform2<
00216 CoordRepType, itkGetStaticConstMacro(SpaceDimension) > EBKernelTransformType;
00217 typedef ElasticBodyReciprocalSplineKernelTransform2<
00218 CoordRepType, itkGetStaticConstMacro(SpaceDimension) > EBRKernelTransformType;
00219
00223 virtual bool SetKernelType( const std::string & kernelType );
00224
00228 virtual void DetermineSourceLandmarks( void );
00229
00234 virtual bool DetermineTargetLandmarks( void );
00235
00237 virtual void ReadLandmarkFile(
00238 const std::string & filename,
00239 PointSetPointer & landmarkPointSet,
00240 const bool & landmarksInFixedImage );
00241
00243 KernelTransformPointer m_KernelTransform;
00244
00245 private:
00246
00248 SplineKernelTransform( const Self& );
00250 void operator=( const Self& );
00251
00252 std::string m_SplineKernelType;
00253
00254 };
00255
00256
00257 }
00258
00259 #ifndef ITK_MANUAL_INSTANTIATION
00260 #include "elxSplineKernelTransform.hxx"
00261 #endif
00262
00263 #endif // end #ifndef __elxSplineKernelTransform_H_