![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00009 #ifndef VDEFORMATION_HH 00010 #define VDEFORMATION_HH 1 00011 00012 #include "gVariables.hh" 00013 00014 // These definitions are used to simply discriminate between forward and backward deformation 00015 #define FORWARD_DEFORMATION 0 00016 #define BACKWARD_DEFORMATION 1 00017 00018 class oImageSpace; 00019 class oImageDimensionsAndQuantification; 00020 00021 00044 class vDeformation 00045 { 00046 // ----------------------------------------------------------------------------------------- 00047 // Constructor & Destructor 00048 public: 00053 vDeformation(); 00058 virtual ~vDeformation(); 00059 00060 00061 // ----------------------------------------------------------------------------------------- 00062 // Public member functions 00063 public: 00069 inline void SetImageDimensionsAndQuantification( oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification ) 00070 {mp_ID = ap_ImageDimensionsAndQuantification;} 00076 inline void SetVerbose( int a_verbose ) 00077 {m_verbose = a_verbose;} 00084 inline void SetNbTransformations( int a_nbTransformations ) 00085 {m_nbTransformations = a_nbTransformations;} 00092 virtual int CheckParameters(); 00099 virtual int CheckSpecificParameters() = 0; 00107 virtual int ReadAndCheckConfigurationFile( const string& a_fileOptions ) = 0; 00115 virtual int ReadAndCheckOptionsList( const string& a_listOptions ) = 0; 00122 virtual int Initialize() = 0; 00128 virtual void ShowHelp() = 0; 00129 00130 00131 // ----------------------------------------------------------------------------------------- 00132 // Reconstruction deformation function 00133 public: 00145 virtual int ApplyDeformationsToForwardImage( oImageSpace* ap_Image, int a_defIdx, int fr, int rimg, int cimg ); 00160 virtual int PerformDeformation( oImageSpace* ap_Image, int a_defIdx, int fr, int rimg, int cimg ); 00174 virtual int PerformHistoSensitivityDeformation( oImageSpace* ap_Image, int a_defIdx, int fr, int rimg, int cimg ); 00185 virtual int ApplyDeformationsToBackwardImage( oImageSpace* ap_Image, int a_defIdx ); 00196 virtual int ApplyDeformationsToHistoSensitivityImage( oImageSpace* ap_Image, int a_defIdx ); 00211 virtual int PerformSensitivityDeformation( oImageSpace* ap_Image, int a_defDirection, int a_defIdx, int fr, int rg, int cg ); 00222 virtual int ApplyDeformations( FLTNB* ap_inputImage, FLTNB* ap_outputImage, int a_direction, int a_defIdx ) = 0; 00223 00224 00225 // ----------------------------------------------------------------------------------------- 00226 // Data members 00227 protected: 00228 oImageDimensionsAndQuantification* mp_ID; 00229 int m_verbose; 00230 int m_nbTransformations; 00231 int m_checked; 00232 int m_initialized; 00233 }; 00234 00235 00236 // ---------------------------------------------------------------------- 00237 // Part of code that manages the auto declaration of children classes 00238 // ---------------------------------------------------------------------- 00239 00240 // Macro for the function that creates the object 00241 #define FUNCTION_DEFORMATION(CLASS) \ 00242 static vDeformation *make_deformation() { return new CLASS(); }; 00243 00244 // Macro for the class that links the appropriate function to the map of objects 00245 #define CLASS_DEFORMATION(NAME,CLASS) \ 00246 class NAME##DeformationCreator \ 00247 { \ 00248 public: \ 00249 NAME##DeformationCreator() \ 00250 { sAddonManager::GetInstance()->mp_listOfDeformations[#NAME] = CLASS::make_deformation; } \ 00251 }; \ 00252 static NAME##DeformationCreator DeformationCreator##NAME; 00253 00254 #endif