![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00008 #ifndef VSCANNER_HH 00009 #define VSCANNER_HH 1 00010 00011 #include "gVariables.hh" 00012 #include "sOutputManager.hh" 00013 #include "oMatrix.hh" 00014 #include "sRNG.hh" 00015 00016 00017 00018 00019 00026 #define GEO_ROT_CW 0 00027 00028 #define GEO_ROT_CCW 1 00029 00035 class sScannerManager; 00036 00037 00046 class vScanner 00047 { 00048 // ------------------------------------------------------------------- 00049 // Constructor & Destructor 00050 public: 00055 vScanner(); 00059 virtual ~vScanner(); 00060 00061 00062 // ------------------------------------------------------------------- 00063 // Public member functions 00064 public: 00073 virtual int Instantiate(bool a_scannerFileIsLUT) = 0; 00082 virtual int BuildLUT(bool a_scannerFileIsLUT) = 0; 00089 virtual int CheckParameters() = 0; 00096 virtual int Initialize() = 0; 00111 virtual int GetPositionsAndOrientations( int a_index1, int a_index2, 00112 FLTNB ap_Position1[3], FLTNB ap_Position2[3], 00113 FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3], 00114 FLTNB* ap_POI1 = NULL, FLTNB* ap_POI2 = NULL ) = 0; 00127 virtual int GetRdmPositionsAndOrientations( int a_index1, int a_index2, 00128 FLTNB ap_Position1[3], FLTNB ap_Position2[3], 00129 FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3] ) = 0; 00140 virtual int GetPositionWithRandomDepth( int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3] ) = 0; 00154 virtual int GetTwoCorners( int a_index1, int a_index2, 00155 FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3], 00156 FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3]) = 0; 00168 virtual int ComputeLUT(); 00180 virtual int LoadLUT(); 00186 virtual int GetSystemNbElts() = 0; 00196 virtual int IsAvailableLOR(int a_elt1, int a_elt2); 00202 virtual void ShowHelp() = 0; 00210 virtual int GetGeometricInfoFromDatafile(string a_path) = 0; 00216 inline int GetScannerType() 00217 {return m_scannerType;} 00223 inline void SetVerbose(int a_verboseLevel) 00224 {m_verbose = a_verboseLevel;}; 00225 00226 00227 // ------------------------------------------------------------------- 00228 // PET dedicated functions (only overloaded by PET scanner class) 00229 public: 00238 virtual int SetPETMaxRingDiff(int a_maxRingDiff); 00246 virtual int GetScannerLayerNbRings(int a_layer); 00255 virtual int PROJ_GetPETSpecificParameters(int* ap_maxRingDiff); 00256 00257 00258 // ------------------------------------------------------------------- 00259 // SPECT dedicated functions (only surcharged by SPECT scanner classes) 00260 public: 00275 virtual int GetSPECTSpecificParameters( uint16_t* ap_nbOfProjections, 00276 uint16_t* ap_nbHeads, 00277 uint16_t* ap_nbOfBins, 00278 FLTNB* ap_pixSizeXY, 00279 FLTNB*& ap_angles, 00280 FLTNB*& ap_CORtoDetectorDistance, 00281 int* ap_headRotDirection ); 00290 virtual int PROJ_SetSPECTNbBins( uint16_t* ap_nbOfBins ); 00299 virtual int PROJ_SetSPECTNbProjections( uint32_t a_nbOfProjections ); 00308 virtual int PROJ_SetSPECTAngles( FLTNB* ap_projectionAngles ); 00317 virtual int PROJ_SetSPECTCORtoDetectorDistance( FLTNB a_CORtoDetectorDistance ); 00326 virtual int PROJ_SetSPECTRotDirection( string a_rotDirection ); 00334 virtual uint16_t PROJ_GetSPECTNbProjections(); // required for analytic projection (computations of indices for projection main loops in sScannerManager) 00342 virtual uint16_t PROJ_GetSPECTNbPixels(); // required for analytic projection (computations of index for projection main loops in sScannerManager) 00343 00344 00345 // ------------------------------------------------------------------- 00346 // Private member functions 00347 private: 00348 00349 00350 // ------------------------------------------------------------------- 00351 // Data members 00352 protected: 00353 int m_scannerType; 00354 int m_verbose; 00355 bool m_allParametersChecked; 00356 oMatrix *mp_rotationMatrix; 00357 oMatrix *mp_positionMatrix_ref; 00358 oMatrix *mp_positionMatrix_out; 00359 }; 00360 00361 00362 // ---------------------------------------------------------------------- 00363 // Part of code that manages the auto declaration of children classes 00364 // ---------------------------------------------------------------------- 00365 00366 // Macro for the function that creates the object 00367 #define FUNCTION_SCANNER(CLASS) \ 00368 static vScanner *make_scanner() { return new CLASS(); }; 00369 00370 // Macro for the class that links the appropriate function to the map of objects 00371 #define CLASS_SCANNER(NAME,CLASS) \ 00372 class NAME##ScannerCreator \ 00373 { \ 00374 public: \ 00375 NAME##ScannerCreator() \ 00376 { sAddonManager::GetInstance()->mp_listOfScannerTypes[#NAME] = CLASS::make_scanner; } \ 00377 }; \ 00378 static NAME##ScannerCreator ScannerCreator##NAME; 00379 00380 #endif