![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00002 /* 00003 Implementation of class iImageProcessingTemplate 00004 00005 - separators: done 00006 - doxygen: done 00007 - default initialization: done 00008 - CASTOR_DEBUG: 00009 - CASTOR_VERBOSE: 00010 */ 00011 00018 #include "iImageProcessingTemplate.hh" 00019 #include "sOutputManager.hh" 00020 00021 // ===================================================================== 00022 // --------------------------------------------------------------------- 00023 // --------------------------------------------------------------------- 00024 // ===================================================================== 00025 00026 iImageProcessingTemplate::iImageProcessingTemplate() : vImageProcessingModule() 00027 { 00028 // Set the booleans that describe if this image processing module will affect each of the dynamic dimension. 00029 // The boolean members m_affectXXXDimensionFlag are used to avoid any misuse of an image processing module due to the indexation 00030 // on dynamic basis functions. Here is an example: if the module is acting on the time dynamics (1st pointer) and actually uses 00031 // the time information to do some processing along this dimension, then the m_affectTimeDimensionFlag must be set to 'true' in 00032 // the constructor. Doing that, the image processing manager will forbid any use of this processing module if time basis functions 00033 // are being used. So this insures that when entering this function, the first pointer of the a4p_image will be frames and not 00034 // generic time basis functions (i.e. there is an equivalence). The same reasoning applies to the respiratory and cardiac dimensions. 00035 m_affectTimeDimensionFlag = false; 00036 m_affectRespDimensionFlag = false; 00037 m_affectCardDimensionFlag = false; 00038 // Affect default values to the parameters specific to this module 00039 } 00040 00041 // ===================================================================== 00042 // --------------------------------------------------------------------- 00043 // --------------------------------------------------------------------- 00044 // ===================================================================== 00045 00046 iImageProcessingTemplate::~iImageProcessingTemplate() 00047 { 00048 // Delete or free all structures specific to this module that were allocated by this module 00049 } 00050 00051 // ===================================================================== 00052 // --------------------------------------------------------------------- 00053 // --------------------------------------------------------------------- 00054 // ===================================================================== 00055 00056 int iImageProcessingTemplate::ReadConfigurationFile(const string& a_configurationFile) 00057 { 00058 // Implement here the reading of any options specific to this image processing module, through a configuration file 00059 00060 // Normal end 00061 return 0; 00062 } 00063 00064 // ===================================================================== 00065 // --------------------------------------------------------------------- 00066 // --------------------------------------------------------------------- 00067 // ===================================================================== 00068 00069 int iImageProcessingTemplate::ReadOptionsList(const string& a_optionsList) 00070 { 00071 // Implement here the reading of any options specific to this image processing module, through a list of options separated by commas 00072 00073 // Normal end 00074 return 0; 00075 } 00076 00077 // ===================================================================== 00078 // --------------------------------------------------------------------- 00079 // --------------------------------------------------------------------- 00080 // ===================================================================== 00081 00082 void iImageProcessingTemplate::ShowHelp() 00083 { 00084 // Here, display some help and guidance to how to use this image processing module and what it does. 00085 // Also describes the form of the configuration file or the list of options that parameterize your module. 00086 cout << "This image processing module is a template class dedicated to add your own custom image processing module." << endl; 00087 } 00088 00089 // ===================================================================== 00090 // --------------------------------------------------------------------- 00091 // --------------------------------------------------------------------- 00092 // ===================================================================== 00093 00094 int iImageProcessingTemplate::CheckSpecificParameters() 00095 { 00096 // Implement here all mandatory checks specific to this image processing module needed for a nice use 00097 00098 // Normal end 00099 return 0; 00100 } 00101 00102 // ===================================================================== 00103 // --------------------------------------------------------------------- 00104 // --------------------------------------------------------------------- 00105 // ===================================================================== 00106 00107 int iImageProcessingTemplate::InitializeSpecific() 00108 { 00109 // Implement here the initialization of whatever member variables specifically used by this image processing module 00110 00111 return 0; 00112 } 00113 00114 // ===================================================================== 00115 // --------------------------------------------------------------------- 00116 // --------------------------------------------------------------------- 00117 // ===================================================================== 00118 00119 int iImageProcessingTemplate::Process(FLTNB**** a4p_image) 00120 { 00121 // Do the processing here. 00122 // The input parameter is the image to be processed. 00123 // For genericity purpose, the a4p_image is indexed using dynamic basis functions and not directly frames and gates indices. 00124 // 1st pointer: time basis functions 00125 // 2nd pointer: respiratory basis functions 00126 // 3rd pointer: cardiac basis functions 00127 // 4th pointer: voxels 00128 // The boolean members m_affectXXXDimensionFlag are used to avoid any misuse of an image processing module due to the indexation 00129 // on dynamic basis functions. Here is an example: if the module is acting on the time dynamics (1st pointer) and actually uses 00130 // the time information to do some processing along this dimension, then the m_affectTimeDimensionFlag must be set to 'true' in 00131 // the constructor. Doing that, the image processing manager will forbid any use of this processing module if time basis functions 00132 // are being used. So this insures that when entering this function, the first pointer of the a4p_image will be frames and not 00133 // generic time basis functions (i.e. there is an equivalence). The same reasoning applies to the respiratory and cardiac dimensions. 00134 // All informations about frames, durations, gates, etc, can be accessed via the object member mp_ImageDimensionsAndQuantification. 00135 00136 // Normal end 00137 return 0; 00138 } 00139 00140 // ===================================================================== 00141 // --------------------------------------------------------------------- 00142 // --------------------------------------------------------------------- 00143 // =====================================================================