CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
vProjector.hh
Go to the documentation of this file.
00001 
00008 #ifndef VPROJECTOR_HH
00009 #define VPROJECTOR_HH 1
00010 
00011 #include "gVariables.hh"
00012 #include "vEvent.hh"
00013 #include "oProjectionLine.hh"
00014 #include "vScanner.hh"
00015 #include "oImageDimensionsAndQuantification.hh"
00016 
00023 #define USE_TOFBIN 1
00024 
00025 #define USE_TOFPOS 2
00026 
00027 #define USE_NOTOF  3
00028 
00052 class vProjector
00053 {
00054   // -------------------------------------------------------------------
00055   // Constructor & Destructor
00056   public:
00063     vProjector();
00071     virtual ~vProjector();
00072 
00073 
00074   // -------------------------------------------------------------------
00075   // Public member functions
00076   public:
00082     void ShowHelp();
00088     static void ShowCommonHelp();
00094     int ReadCommonOptionsList(const string& a_optionsList);
00103     int CheckParameters();
00113     int Initialize();
00136     int Project(int a_direction, oProjectionLine* ap_ProjectionLine, uint32_t* ap_index1, uint32_t* ap_index2, int a_nbIndices);
00137 
00138 
00139   // -------------------------------------------------------------------
00140   // Virtual but not pure for children
00141   public:
00151     virtual INTNB EstimateMaxNumberOfVoxelsPerLine();
00152 
00153 
00154   // -------------------------------------------------------------------
00155   // Pure virtual public member functions that need to be implemented by children
00156   public:
00167     virtual int ReadConfigurationFile(const string& a_configurationFile) = 0;
00178     virtual int ReadOptionsList(const string& a_optionsList) = 0;
00179 
00180 
00181   // -------------------------------------------------------------------
00182   // Pure virtual private member functions that need to be implemented by children
00183   private:
00192     virtual void ShowHelpSpecific() = 0;
00201     virtual int CheckSpecificParameters() = 0;
00211     virtual int InitializeSpecific() = 0;
00221     virtual int ProjectWithoutTOF( int a_direction, oProjectionLine* ap_ProjectionLine ) = 0;
00232     virtual int ProjectWithTOFPos( int a_direction, oProjectionLine* ap_ProjectionLine ) = 0;
00243     virtual int ProjectWithTOFBin( int a_direction, oProjectionLine* ap_ProjectionLine ) = 0;
00244 
00245 
00246   // -------------------------------------------------------------------
00247   // Public Get & Set functions
00248   public:
00254     inline void SetVerbose(int a_verbose)
00255            {m_verbose = a_verbose;}
00261     inline void SetScanner(vScanner* ap_Scanner)
00262            {mp_Scanner = ap_Scanner;}
00269     int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification);
00278     int SetTOFAndPOIOptions(int a_dataType, bool a_ignoreTOF, bool a_ignorePOI);
00283     inline bool GetCompatibilityWithSPECTAttenuationCorrection()
00284            {return m_compatibleWithSPECTAttenuationCorrection;}
00285 
00286 
00287   // -------------------------------------------------------------------
00288   // Data members
00289   protected:
00290     // Few data from the oImageDimensionsAndQuantification to avoid getting them too often
00291     FLTNB mp_sizeVox[3];                   
00292     INTNB mp_nbVox[3];                     
00293     INTNB m_nbVoxXY;                       
00294     FLTNB mp_halfFOV[3];                   
00295     // Image dimensions
00296     oImageDimensionsAndQuantification* 
00297       mp_ImageDimensionsAndQuantification; 
00298     // Scanner
00299     vScanner* mp_Scanner;                  
00300     // Integer flag to say if TOF are applied and how
00301     int m_applyTOF;                        
00302     // Flag for POI
00303     bool m_applyPOI;                       
00305     // Flag that says if the projector is compatible with SPECT attenuation correction
00306     bool m_compatibleWithSPECTAttenuationCorrection; 
00307     // Verbosity
00308     int m_verbose;                         
00309     // Has been checked ?
00310     bool m_checked;                        
00311     // Has been initialized ?
00312     bool m_initialized;                    
00313 };
00314 
00315 // ----------------------------------------------------------------------
00316 // Part of code that manages the auto declaration of children classes
00317 // ----------------------------------------------------------------------
00318 
00319 // Macro for the function that creates the object
00320 #define FUNCTION_PROJECTOR(CLASS) \
00321   static vProjector *make_projector() { return new CLASS(); };
00322 
00323 // Macro for the class that links the appropriate function to the map of objects
00324 #define CLASS_PROJECTOR(NAME,CLASS)                                                           \
00325   class NAME##ProjectorCreator                                                                \
00326   {                                                                                           \
00327     public:                                                                                   \
00328       NAME##ProjectorCreator()                                                                \
00329         { sAddonManager::GetInstance()->mp_listOfProjectors[#NAME] = CLASS::make_projector; } \
00330   };                                                                                          \
00331   static NAME##ProjectorCreator ProjectorCreator##NAME;
00332 
00333 #endif
 All Classes Files Functions Variables Typedefs Defines