CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
oDeformationManager.hh
Go to the documentation of this file.
00001 
00009 #ifndef ODEFORMATIONMANAGER_HH
00010 #define ODEFORMATIONMANAGER_HH 1
00011 
00012 #include "gVariables.hh"
00013 #include "vDeformation.hh"
00014 #include "vDataFile.hh"
00015 
00016 // =====================================================================
00017 // ---------------------------------------------------------------------
00018 // ---------------------------------------------------------------------
00019 // =====================================================================
00026 #define DEF_RESP_MOT 0
00027 
00028 #define DEF_CARD_MOT 1
00029 
00030 #define DEF_IPAT_MOT 2
00031 
00033 class vDataFile;
00034 
00035 
00036 
00047 class oDeformationManager
00048 {
00049   // Constructor & Destructor
00050   public:
00055     oDeformationManager();
00056     
00061     ~oDeformationManager();
00062 
00063 
00064   // -------------------------------------------------------------------
00065   // Public member functions
00066   public:
00073     int CheckParameters();
00080     int Initialize();
00087     void InstantiateImageForDeformation(oImageSpace* ap_Image);
00094     void DeallocateImageForDeformation(oImageSpace* ap_Image);
00101     void InitImageForDeformation(oImageSpace* ap_Image);
00102 
00103 
00104   // -------------------------------------------------------------------
00105   // Public Get & Set functions
00106   public:
00112     inline void SetVerbose(int a_verboseLevel)
00113            {m_verbose = a_verboseLevel;}
00120     inline void SetDataMode(int a_dataMode)
00121            {m_dataMode = a_dataMode;}
00127     inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification) 
00128                                                    {mp_ID = ap_ImageDimensionsAndQuantification;}
00135     inline void SetOptionsResp(const string& a_optionsResp, int a_nbGates) 
00136            {m_optionsResp = a_optionsResp; m_nbRespGates = a_nbGates;}
00143     inline void SetOptionsCard(const string& a_optionsCard, int a_nbGates)
00144            {m_optionsCard = a_optionsCard; m_nbCardGates = a_nbGates;}
00150     inline void SetOptionsInv(const string& a_optionsInv) 
00151            {m_optionsInv = a_optionsInv;}
00157     inline bool UseDeformationResp()
00158            {return m_UseDeformationResp;}
00164     inline bool UseDeformationCard()
00165            {return m_UseDeformationCard;}
00171     inline bool UseDeformationInv()
00172            {return m_UseDeformationInv;}
00179     inline int GetNbSensImagesRespDeformation(int a_value) 
00180            {if (UseDeformationResp()) return 0; else return a_value;}
00187     inline int GetNbSensImagesCardDeformation(int a_value) 
00188            {if (UseDeformationCard()) return 0; else return a_value;}
00189 
00190 
00191   // -------------------------------------------------------------------
00192     // Deformation functions
00207     int ApplyDeformationForSensitivityGeneration(oImageSpace* ap_Image, int a_defDirection, int a_defType, int fr, int rg, int cg);
00215     int ApplyDeformationsToForwardImage(oImageSpace* ap_Image);
00224     int ApplyDeformationsToBackwardImage(oImageSpace* ap_Image);
00234     int PerformDeformation(oImageSpace* ap_Image);
00235 
00236 
00237   // -------------------------------------------------------------------
00238   // Private member functions
00239   private:
00252     int ParseOptionsAndInitializeDeformations();
00253 
00254 
00255   // -------------------------------------------------------------------
00256   // Data members
00257   private:
00258     // Image dimensions
00259     oImageDimensionsAndQuantification* mp_ID; 
00260     // Options for each deformation type
00261     string m_optionsResp;                     
00262     string m_optionsCard;                     
00263     string m_optionsInv;                      
00264     // Deformation objects and associated bool
00265     vDeformation* mp_DeformationResp;          // TODO Mix the two gating motion together as physiological motion ? 
00266     vDeformation* mp_DeformationCard;         
00267     vDeformation* mp_DeformationInv;          
00268     bool m_UseDeformationResp;                
00269     bool m_UseDeformationCard;                
00270     bool m_UseDeformationInv;                 
00271     // Variable indicating the current gate for the different types of motion
00272     int m_currentRespGate;                    
00273     int m_currentCardGate;                    
00274     int m_currentPMotionIndex;                
00275     // Number of gates for cyclic motion
00276     int m_nbRespGates;                        
00277     int m_nbCardGates;                        
00278     // Verbose level
00279     int m_verbose;                            
00280     // Data mode
00281     int m_dataMode;                           
00282     // Has been checked ?
00283     bool m_checked;                           
00284     // Has been initialized ?
00285     bool m_initialized;                       
00286 };
00287 
00288 #endif
 All Classes Files Functions Variables Typedefs Defines