![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00002 /* 00003 Implementation of class sAddonManager 00004 00005 - separators: 00006 - doxygen: 00007 - default initialization: 00008 - CASTOR_DEBUG: 00009 - CASTOR_VERBOSE: 00010 */ 00011 00019 #include "sAddonManager.hh" 00020 00021 // ===================================================================== 00022 // --------------------------------------------------------------------- 00023 // --------------------------------------------------------------------- 00024 // ===================================================================== 00025 00026 sAddonManager* sAddonManager::mp_Instance = NULL; 00027 sAddonManager::sAddonManager() {;} 00028 00029 // ===================================================================== 00030 // --------------------------------------------------------------------- 00031 // --------------------------------------------------------------------- 00032 // ===================================================================== 00033 00034 void sAddonManager::ShowHelpProjector() 00035 { 00036 // Return when using MPI and mpi_rank is not 0 00037 #ifdef CASTOR_MPI 00038 int mpi_rank = 0; 00039 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00040 if (mpi_rank!=0) return; 00041 #endif 00042 // Get the list of projectors 00043 std::map<string,maker_projector> list = sAddonManager::GetInstance()->mp_listOfProjectors; 00044 std::map<string,maker_projector>::iterator iter; 00045 cout << endl << "Here is the list of all implemented projectors along with their options:" << endl << endl; 00046 for (iter = list.begin(); iter!=list.end(); iter++) 00047 { 00048 // Print out the name of this projector 00049 cout << "------------------------------------------------------------------" << endl; 00050 cout << "----- \"" << iter->first << "\"" << endl; 00051 cout << "------------------------------------------------------------------" << endl; 00052 // Proceed 00053 if (iter->second) 00054 { 00055 // Create it 00056 vProjector* projector = iter->second(); 00057 // Print specific help 00058 projector->ShowHelp(); 00059 // Delete it 00060 delete projector; 00061 } 00062 cout << endl; 00063 } 00064 } 00065 00066 // ===================================================================== 00067 // --------------------------------------------------------------------- 00068 // --------------------------------------------------------------------- 00069 // ===================================================================== 00070 00071 void sAddonManager::ShowHelpOptimizer() 00072 { 00073 // Return when using MPI and mpi_rank is not 0 00074 #ifdef CASTOR_MPI 00075 int mpi_rank = 0; 00076 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00077 if (mpi_rank!=0) return; 00078 #endif 00079 // Get the list of optimizers 00080 std::map<string,maker_optimizer> list = sAddonManager::GetInstance()->mp_listOfOptimizers; 00081 std::map<string,maker_optimizer>::iterator iter; 00082 cout << endl << "Here is the list of all implemented optimizers along with their options:" << endl << endl; 00083 for (iter = list.begin(); iter!=list.end(); iter++) 00084 { 00085 // Print out the name of this optimizer 00086 cout << "------------------------------------------------------------------" << endl; 00087 cout << "----- \"" << iter->first << "\"" << endl; 00088 cout << "------------------------------------------------------------------" << endl; 00089 // Proceed 00090 if (iter->second) 00091 { 00092 // Create it 00093 vOptimizer* optimizer = iter->second(); 00094 // Print specific help 00095 optimizer->ShowHelp(); 00096 // Delete it 00097 delete optimizer; 00098 } 00099 cout << endl; 00100 } 00101 } 00102 00103 // ===================================================================== 00104 // --------------------------------------------------------------------- 00105 // --------------------------------------------------------------------- 00106 // ===================================================================== 00107 00108 void sAddonManager::ShowHelpScanner() 00109 { 00110 // Return when using MPI and mpi_rank is not 0 00111 #ifdef CASTOR_MPI 00112 int mpi_rank = 0; 00113 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00114 if (mpi_rank!=0) return; 00115 #endif 00116 // Get the list of scanners 00117 std::map<string,maker_scanner> list = sAddonManager::GetInstance()->mp_listOfScannerTypes; 00118 std::map<string,maker_scanner>::iterator iter; 00119 cout << endl << "Here is the list of all implemented systems along with their options:" << endl << endl; 00120 for (iter = list.begin(); iter!=list.end(); iter++) 00121 { 00122 // Print out the name of this scanner 00123 cout << "------------------------------------------------------------------" << endl; 00124 cout << "----- \"" << iter->first << "\"" << endl; 00125 cout << "------------------------------------------------------------------" << endl; 00126 // Proceed 00127 if (iter->second) 00128 { 00129 // Create it 00130 vScanner* scanner = iter->second(); 00131 // Print specific help 00132 scanner->ShowHelp(); 00133 // Delete it 00134 delete scanner; 00135 } 00136 cout << endl; 00137 } 00138 } 00139 00140 // ===================================================================== 00141 // --------------------------------------------------------------------- 00142 // --------------------------------------------------------------------- 00143 // ===================================================================== 00144 00145 void sAddonManager::ShowHelpImageConvolver() 00146 { 00147 // Return when using MPI and mpi_rank is not 0 00148 #ifdef CASTOR_MPI 00149 int mpi_rank = 0; 00150 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00151 if (mpi_rank!=0) return; 00152 #endif 00153 // Get the list of image convolvers 00154 std::map<string,maker_image_convolver> list = sAddonManager::GetInstance()->mp_listOfImageConvolvers; 00155 std::map<string,maker_image_convolver>::iterator iter; 00156 cout << endl << "Here is the list of all implemented image convolvers along with their options:" << endl << endl; 00157 for (iter = list.begin(); iter!=list.end(); iter++) 00158 { 00159 // Print out the name of this convolver 00160 cout << "------------------------------------------------------------------" << endl; 00161 cout << "----- \"" << iter->first << "\"" << endl; 00162 cout << "------------------------------------------------------------------" << endl; 00163 // Proceed 00164 if (iter->second) 00165 { 00166 // Create it 00167 vImageConvolver* convolver = iter->second(); 00168 // Print specific help 00169 convolver->ShowHelp(); 00170 // Delete it 00171 delete convolver; 00172 } 00173 cout << endl; 00174 } 00175 } 00176 00177 // ===================================================================== 00178 // --------------------------------------------------------------------- 00179 // --------------------------------------------------------------------- 00180 // ===================================================================== 00181 00182 void sAddonManager::ShowHelpImageProcessingModule() 00183 { 00184 // Return when using MPI and mpi_rank is not 0 00185 #ifdef CASTOR_MPI 00186 int mpi_rank = 0; 00187 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00188 if (mpi_rank!=0) return; 00189 #endif 00190 // Get the list of image processing modules 00191 std::map<string,maker_image_processing_module> list = sAddonManager::GetInstance()->mp_listOfImageProcessingModules; 00192 std::map<string,maker_image_processing_module>::iterator iter; 00193 cout << endl << "Here is the list of all implemented image processing modules along with their options:" << endl << endl; 00194 for (iter = list.begin(); iter!=list.end(); iter++) 00195 { 00196 // Print out the name of this processing module 00197 cout << "------------------------------------------------------------------" << endl; 00198 cout << "----- \"" << iter->first << "\"" << endl; 00199 cout << "------------------------------------------------------------------" << endl; 00200 // Proceed 00201 if (iter->second) 00202 { 00203 // Create it 00204 vImageProcessingModule* module = iter->second(); 00205 // Print specific help 00206 module->ShowHelp(); 00207 // Delete it 00208 delete module; 00209 } 00210 cout << endl; 00211 } 00212 } 00213 00214 // ===================================================================== 00215 // --------------------------------------------------------------------- 00216 // --------------------------------------------------------------------- 00217 // ===================================================================== 00218 00219 void sAddonManager::ShowHelpPenalty() 00220 { 00221 // Return when using MPI and mpi_rank is not 0 00222 #ifdef CASTOR_MPI 00223 int mpi_rank = 0; 00224 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00225 if (mpi_rank!=0) return; 00226 #endif 00227 // Get the list of penalties 00228 std::map<string,maker_penalty> list = sAddonManager::GetInstance()->mp_listOfPenalties; 00229 std::map<string,maker_penalty>::iterator iter; 00230 cout << endl << "Here is the list of all implemented penalties along with their options:" << endl << endl; 00231 for (iter = list.begin(); iter!=list.end(); iter++) 00232 { 00233 // Print out the name of this penalty 00234 cout << "------------------------------------------------------------------" << endl; 00235 cout << "----- \"" << iter->first << "\"" << endl; 00236 cout << "------------------------------------------------------------------" << endl; 00237 // Proceed 00238 if (iter->second) 00239 { 00240 // Create it 00241 vPenalty* penalty = iter->second(); 00242 // Print specific help 00243 //penalty->ShowHelp(); 00244 // Delete it 00245 delete penalty; 00246 } 00247 cout << endl; 00248 } 00249 } 00250 00251 // ===================================================================== 00252 // --------------------------------------------------------------------- 00253 // --------------------------------------------------------------------- 00254 // ===================================================================== 00255 00256 void sAddonManager::ShowHelpDynamicModel() 00257 { 00258 // Return when using MPI and mpi_rank is not 0 00259 #ifdef CASTOR_MPI 00260 int mpi_rank = 0; 00261 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00262 if (mpi_rank!=0) return; 00263 #endif 00264 // Get the list of dynamic models 00265 std::map<string,maker_dynamic_model> list = sAddonManager::GetInstance()->mp_listOfDynamicModels; 00266 std::map<string,maker_dynamic_model>::iterator iter; 00267 cout << endl << "Here is the list of all implemented models along with their options:" << endl << endl; 00268 for (iter = list.begin(); iter!=list.end(); iter++) 00269 { 00270 // Print out the name of this dynamic model 00271 cout << "------------------------------------------------------------------" << endl; 00272 cout << "----- \"" << iter->first << "\"" << endl; 00273 cout << "------------------------------------------------------------------" << endl; 00274 // Proceed 00275 if (iter->second) 00276 { 00277 // Create it 00278 vDynamicModel* dynamic_model = iter->second(); 00279 // Print specific help 00280 dynamic_model->ShowHelp(); 00281 // Delete it 00282 delete dynamic_model; 00283 } 00284 cout << endl; 00285 } 00286 } 00287 00288 // ===================================================================== 00289 // --------------------------------------------------------------------- 00290 // --------------------------------------------------------------------- 00291 // ===================================================================== 00292 00293 void sAddonManager::ShowHelpDeformation() 00294 { 00295 // Return when using MPI and mpi_rank is not 0 00296 #ifdef CASTOR_MPI 00297 int mpi_rank = 0; 00298 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); 00299 if (mpi_rank!=0) return; 00300 #endif 00301 // Get the list of deformations 00302 std::map<string,maker_deformation> list = sAddonManager::GetInstance()->mp_listOfDeformations; 00303 std::map<string,maker_deformation>::iterator iter; 00304 cout << endl << "Here is the list of all implemented image deformation algorithms along with their options:" << endl << endl; 00305 for (iter = list.begin(); iter!=list.end(); iter++) 00306 { 00307 // Print out the name of this deformation 00308 cout << "------------------------------------------------------------------" << endl; 00309 cout << "----- \"" << iter->first << "\"" << endl; 00310 cout << "------------------------------------------------------------------" << endl; 00311 // Proceed 00312 if (iter->second) 00313 { 00314 // Create it 00315 vDeformation* deformation = iter->second(); 00316 // Print specific help 00317 deformation->ShowHelp(); 00318 // Delete it 00319 delete deformation; 00320 } 00321 cout << endl; 00322 } 00323 } 00324 00325 // ===================================================================== 00326 // --------------------------------------------------------------------- 00327 // --------------------------------------------------------------------- 00328 // =====================================================================