CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00009 #ifndef OIMAGESPACE_HH 00010 #define OIMAGESPACE_HH 1 00011 00012 #include "gVariables.hh" 00013 #include "oImageDimensionsAndQuantification.hh" 00014 #include "oDeformationManager.hh" 00015 #include "oInterfileIO.hh" 00016 00017 class vOptimizer; 00018 00019 00020 00041 class oImageSpace 00042 { 00043 // Constructor & Destructor 00044 public: 00049 oImageSpace(); 00053 ~oImageSpace(); 00054 00055 00056 // ------------------------------------------------------------------- 00057 // Public member functions 00058 public: 00059 00060 // Let these pointers public to simplify getting them in other classes 00061 FLTNB**** m4p_image; 00068 FLTNB**** m4p_forwardImage; 00075 FLTNB****** m6p_backwardImage; 00085 FLTNB***** m5p_sensitivity; 00093 FLTNB**** m4p_anatomicalImage; 00100 FLTNB* mp_maskImage; 00104 FLTNB* mp_visitedVoxelsImage; 00108 FLTNB**** m4p_attenuation; 00115 FLTNB**** m4p_outputImage; 00124 FLTNB***** m5p_defTmpBackwardImage; 00135 FLTNB**** m4p_defTmpSensitivityImage; 00144 FLTNB** m2p_projectionImage; 00151 // ------------------------------------------------------------------- 00156 void InstantiateImage(); 00161 void InstantiateForwardImage(); 00167 void InstantiateBackwardImage(int a_nbBackwardImages); 00178 void InstantiateSensitivityImage(const string& a_pathToSensitivityImage); 00186 int InitAnatomicalImage(const string& a_pathToAnatomicalImage); 00194 int InitMaskImage(const string& a_pathToImage); 00202 void InstantiateOutputImage(); 00207 void InstantiateBwdImageForDeformation(); 00212 void InstantiateSensImageForDeformation(); 00217 void InstantiateVisitedVoxelsImage(); 00222 void DeallocateImage(); 00227 void DeallocateForwardImage(); 00232 void DeallocateBackwardImage(); 00240 void DeallocateSensitivityImage(); 00245 void DeallocateAnatomicalImage(); 00250 void DeallocateMaskImage(); 00255 void DeallocateBwdImageForDeformation(); 00260 void DeallocateSensImageForDeformation(); 00265 void DeallocateOutputImage(); 00270 void DeallocateVisitedVoxelsImage(); 00280 int InitImage(const string& a_pathToInitialImage, FLTNB a_value); 00285 void InitBackwardImage(); 00296 int InitSensitivityImage(const string& a_pathToSensitivityImage); 00303 void InitBwdImageForDeformation(); 00308 void InitSensImageForDeformation(); 00315 int LoadInitialImage(const string& a_pathToImage); 00321 void ComputeOutputImage(); 00327 int ApplyOutputFOVMasking(); 00333 int ApplyOutputFlip(); 00341 int SaveOutputImage(int a_iteration, int a_subset = -1); 00347 void SaveDebugImage(const string& a_name); 00352 void PrepareForwardImage(); 00357 void Reduce(); 00363 void CleanNeverVisitedVoxels(); 00364 00365 00366 // ------------------------------------------------------------------- 00367 // Functions for List-Mode Sensitivity Generation process 00368 00374 void LMS_InstantiateImage(); 00380 void LMS_InstantiateForwardImage(); 00386 void LMS_InstantiateBackwardImage(); 00392 void LMS_InstantiateSensitivityImage(); 00398 void LMS_DeallocateImage(); 00404 void LMS_DeallocateForwardImage(); 00410 void LMS_DeallocateBackwardImage(); 00416 void LMS_DeallocateSensitivityImage(); 00421 void LMS_DeallocateAttenuationImage(); 00431 int InitAttenuationImage(const string& a_pathToAtnImage); 00439 int LoadAttenuationImage(const string& a_pathToImage); 00445 void LMS_CopyAtnToImage(); 00451 void LMS_CopyAtnToForwardImage(); 00457 void LMS_CopyBackwardToSensitivity(); 00463 void LMS_PrepareForwardImage(); 00472 void LMS_Reduce(int a_frame, int a_rGate, int a_cGate); 00481 int LMS_SaveSensitivityImage(const string& a_pathToSensitivityImage, oDeformationManager* ap_DeformationManager); 00482 00483 00484 // ------------------------------------------------------------------- 00485 // Functions for ANALYTICAL PROJECTION process 00486 00495 void PROJ_InstantiateProjectionImage(int a_nbProjs, int a_nbPixels); 00503 void PROJ_DeallocateProjectionImage(int a_nbProjs); 00510 int PROJ_InitImage(const string& a_pathToInitialImage); 00517 int PROJ_LoadInitialImage(const string& a_pathToImage); 00525 int PROJ_SaveProjectionImage(); 00526 00527 00528 // ------------------------------------------------------------------- 00529 // Public Get and Set functions 00530 public: 00536 inline void SetVerbose(int a_verboseLevel) 00537 {m_verbose = a_verboseLevel;} 00543 inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification) 00544 {mp_ID = ap_ImageDimensionsAndQuantification;} 00549 inline int GetNbBackwardImages() 00550 {return m_nbBwdImages;} 00555 inline bool IsLoadedSensitivity() 00556 {return m_loadedSensitivity;} 00561 inline bool IsLoadedAnatomical() 00562 {return m_loadedAnatomical;} 00567 inline bool IsLoadedMask() 00568 {return m_loadedMask;} 00574 inline bool Checked() 00575 {return mp_ID!=NULL && m_verbose!=-1;} 00576 00577 00578 // ------------------------------------------------------------------- 00579 // Data members 00580 private: 00581 oImageDimensionsAndQuantification* mp_ID; 00582 int m_verbose; 00583 bool m_loadedSensitivity; 00584 bool m_loadedAnatomical; 00585 bool m_loadedMask; 00586 int m_nbBwdImages; 00587 }; 00588 00589 #endif