00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freCenteredAffineTransformController_h
00023 #define __freCenteredAffineTransformController_h
00024
00025 #include "freMatrixOffsetTransformControllerBase.h"
00026 #include "freTransformInitializer.h"
00027
00028 #include "freIntensityImageMediaController.h"
00029
00030 #include "itkCenteredAffineTransform.h"
00031
00032 namespace FREE
00033 {
00034
00046 freControllerIDMacro(CenteredAffineTransformControllerBase, "CenteredAffineTransformBase");
00047 template <int iDimension>
00048 class CenteredAffineTransformControllerBase : public MatrixOffsetTransformControllerBase< itk::CenteredAffineTransform<ScalarType,iDimension>, iDimension>
00049 {
00050 public:
00051 typedef itk::CenteredAffineTransform<ScalarType,iDimension> ComponentType;
00052 typedef MatrixOffsetTransformControllerBase<ComponentType, iDimension> Superclass;
00053
00054 itkTypeMacro(CenteredAffineTransformControllerBase, MatrixOffsetTransformControllerBase);
00055
00056 protected:
00057 CenteredAffineTransformControllerBase()
00058 {
00059
00060 this->UpdateControllerID(ControllerID::CenteredAffineTransformControllerBase);
00061 this->m_Description = "A affine transformation, composed of rotation (around a specified center), scaling, shearing and translation.";
00062 };
00063
00064 virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00065 const SessionComponentCache* pComponentCache,
00066 bool bRegardOldSetup) const
00067 {
00068
00069 profile.Parameters().AddParameter("CenterType",Parameter::PVTInteger,"Type of rotation center computation.\n0: Centers are defined by the first pair of references.\n1: use geometrical center for calculation\n2: center of mass for calculation.",1,"1");
00070 profile.Parameters().AddParameter(cParam_InitialisationMethod,Parameter::PVTInteger,std::string(cParamDsc_InitialisationMethod)+"\n1: matrix is set by itv\n2: center is set by itv\n3: matrix and center are set by itv\n4: translation is set by itv\n5: matrix and translation are set by itv\n6: center and translation are set by itv\n7: all are set by itv",1,"0");
00071
00072
00073 profile.MediaMap().AddMedia("movingInitialImage",ControllerID::IntensityImageMediaControllerBase, DASet,iDimension,0);
00074 profile.MediaMap().AddMedia("fixedInitialImage",ControllerID::IntensityImageMediaControllerBase, DASet,iDimension,0);
00075 };
00076 };
00077
00089 freControllerIDMacro(CenteredAffine2DTransformController, "Centered Affine 2D Transform");
00090 class CenteredAffine2DTransformController : public CenteredAffineTransformControllerBase<2>
00091 {
00092 public:
00093
00094 itkTypeMacro(CenteredAffine2DTransformController, CenteredAffineTransformControllerBase);
00095
00096 CenteredAffine2DTransformController();
00097
00098 protected:
00099 virtual bool SetInitialTransformValues( ComponentType* pTransformComponent,
00100 SessionComponentCache* pComponentCache,
00101 SessionInfo* pSessionInfo,
00102 const int& iInitializeByITV) const;
00103
00104 virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00105 const SessionComponentCache* pComponentCache,
00106 bool bRegardOldSetup) const;
00107 };
00108
00120 freControllerIDMacro(CenteredAffine3DTransformController, "Centered Affine 3D Transform");
00121 class CenteredAffine3DTransformController : public CenteredAffineTransformControllerBase<3>
00122 {
00123 public:
00124 itkTypeMacro(CenteredAffine3DTransformController, CenteredAffineTransformControllerBase);
00125
00126 CenteredAffine3DTransformController();
00127
00128 protected:
00129 virtual bool SetInitialTransformValues( ComponentType* pTransformComponent,
00130 SessionComponentCache* pComponentCache,
00131 SessionInfo* pSessionInfo,
00132 const int& iInitializeByITV) const;
00133
00134 virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00135 const SessionComponentCache* pComponentCache,
00136 bool bRegardOldSetup) const;
00137 };
00138 }
00139
00140 #endif