![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
Singleton class that manages output writing on disk (images, sinograms, etc).
It also manages logging and printing on screen.
More...
#include <sOutputManager.hh>
Public Member Functions | |
void | SetVerbose (int a_verbose) |
set verbosity | |
ofstream & | GetLogFile () |
const string & | GetBaseName () |
const string & | GetPathName () |
void | SetMPIRank (int a_mpiRank) |
Initialize the machine index for MPI. | |
void | SetMergeDynImagesFlag (bool a_flag) |
Set to on the flag indicating that a dynamic serie of 3D images should be written on disk in one file instead of one file for each 3D image associated with a metaheader, or not. | |
bool | MergeDynImages () |
Indicate if a dynamic serie of 3D images should be merged in one file (true) or written on disk as one file for each 3D image, associated with an Interfile metaheader. | |
int | CheckConfigDir (const string &a_path) |
Set the path to the CASTOR config directory from the given path if not empty or through the existence of the environment variable CASTOR_CONFIG. | |
const string & | GetPathToConfigDir () |
Return the path to the CASTOR config directory. | |
int | InitOutputDirectory (const string &a_pathFout, const string &a_pathDout) |
Create the output directory if any, extract the base name and create the log file. | |
int | LogCommandLine (int argc, char **argv) |
Write log file header with the provided command line options and different informations. | |
Static Public Member Functions | |
static sOutputManager * | GetInstance () |
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise. | |
Private Member Functions | |
sOutputManager () | |
sOutputManager constructor. | |
~sOutputManager () | |
sOutputManager destructor. | |
sOutputManager (sOutputManager const &) | |
void | operator= (sOutputManager const &) |
Private Attributes | |
int | m_verbose |
int | m_mpiRank |
string | m_baseName |
string | m_pathName |
string | m_pathToConfigDir |
ofstream | m_logFile |
bool | m_mergeOutputDynImgFlag |
Static Private Attributes | |
static sOutputManager * | mp_Instance = NULL |
Singleton class that manages output writing on disk (images, sinograms, etc).
It also manages logging and printing on screen.
Definition at line 112 of file sOutputManager.hh.
sOutputManager::sOutputManager | ( | ) | [private] |
sOutputManager constructor.
It is private at this class is singleton. It should be instanciated using the GetInstance() function Initialize the member variables to their default values.
Definition at line 56 of file sOutputManager.cc.
sOutputManager::~sOutputManager | ( | ) | [private] |
sOutputManager destructor.
Definition at line 80 of file sOutputManager.cc.
sOutputManager::sOutputManager | ( | sOutputManager const & | ) | [inline, private] |
Definition at line 237 of file sOutputManager.hh.
int sOutputManager::CheckConfigDir | ( | const string & | a_path | ) |
Set the path to the CASTOR config directory from the given path if not empty or through the existence of the environment variable CASTOR_CONFIG.
a_path |
Definition at line 100 of file sOutputManager.cc.
const string & sOutputManager::GetBaseName | ( | ) | [inline] |
Definition at line 150 of file sOutputManager.hh.
static sOutputManager * sOutputManager::GetInstance | ( | ) | [inline, static] |
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
Definition at line 123 of file sOutputManager.hh.
ofstream & sOutputManager::GetLogFile | ( | ) | [inline] |
Definition at line 144 of file sOutputManager.hh.
const string & sOutputManager::GetPathName | ( | ) | [inline] |
Definition at line 156 of file sOutputManager.hh.
const string & sOutputManager::GetPathToConfigDir | ( | ) |
Return the path to the CASTOR config directory.
Just return the path if it has already been initialized Otherwise, the function recovers the path from environnement variables If any error, the working directory is returned instead
Definition at line 160 of file sOutputManager.cc.
int sOutputManager::InitOutputDirectory | ( | const string & | a_pathFout, |
const string & | a_pathDout | ||
) |
Create the output directory if any, extract the base name and create the log file.
a_pathFout | : path to an output file as provided by the user |
a_pathDout | : path to an output directory as provided by the user |
Definition at line 217 of file sOutputManager.cc.
int sOutputManager::LogCommandLine | ( | int | argc, |
char ** | argv | ||
) |
Write log file header with the provided command line options and different informations.
argc | |
argv |
Definition at line 339 of file sOutputManager.cc.
bool sOutputManager::MergeDynImages | ( | ) | [inline] |
Indicate if a dynamic serie of 3D images should be merged in one file (true) or written on disk as one file for each 3D image, associated with an Interfile metaheader.
Definition at line 180 of file sOutputManager.hh.
void sOutputManager::operator= | ( | sOutputManager const & | ) | [inline, private] |
Definition at line 238 of file sOutputManager.hh.
void sOutputManager::SetMergeDynImagesFlag | ( | bool | a_flag | ) | [inline] |
Set to on the flag indicating that a dynamic serie of 3D images should be written on disk in one file instead of one file for each 3D image associated with a metaheader, or not.
a_flag |
Definition at line 172 of file sOutputManager.hh.
void sOutputManager::SetMPIRank | ( | int | a_mpiRank | ) | [inline] |
Initialize the machine index for MPI.
a_mpiRank |
Definition at line 163 of file sOutputManager.hh.
void sOutputManager::SetVerbose | ( | int | a_verbose | ) | [inline] |
set verbosity
a_verbose |
Definition at line 138 of file sOutputManager.hh.
string sOutputManager::m_baseName [private] |
String containing the image base name
Definition at line 247 of file sOutputManager.hh.
ofstream sOutputManager::m_logFile [private] |
File object for the output log file
Definition at line 250 of file sOutputManager.hh.
bool sOutputManager::m_mergeOutputDynImgFlag [private] |
Flag indicating if dynamic image should be written on disk as one file (true), or a serie of 3D image associated with a metaheader (false). Default: false
Definition at line 251 of file sOutputManager.hh.
int sOutputManager::m_mpiRank [private] |
Machine index for MPI
Definition at line 246 of file sOutputManager.hh.
string sOutputManager::m_pathName [private] |
String containing the path to the output directory
Definition at line 248 of file sOutputManager.hh.
string sOutputManager::m_pathToConfigDir [private] |
String containing the path to the CASToR configuration directory
Definition at line 249 of file sOutputManager.hh.
int sOutputManager::m_verbose [private] |
Verbosity
Definition at line 245 of file sOutputManager.hh.
sOutputManager * sOutputManager::mp_Instance = NULL [static, private] |
Pointer to this singleton object
Definition at line 238 of file sOutputManager.hh.