101 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Image dimensions and quantification object is null !" << endl);
106 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Image space object is null !" << endl);
111 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Scanner object is null !" << endl);
116 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Projector manager object is null !" << endl);
121 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Convolver manager object is null !" << endl);
126 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Deformation manager object is null !" << endl);
131 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Data file array is null !" << endl);
138 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Data file object for bed " << b+1 <<
" is null !" << endl);
144 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Verbose level is negative !" << endl);
150 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> It was asked to compute global sensitivity from the provided datafile whereas it is not a histogram !" << endl);
158 Cerr(
"***** oSensitivityGenerator::CheckParameters() -> Global sensitivity computation from histogram does not work wth dynamic data yet !" << endl);
177 Cerr(
"***** oSensitivityGenerator::Initialize() -> Must call the CheckParameters() function before initialization !" << endl);
181 if (
m_verbose>=2)
Cout(
"oSensitivityGenerator::Initialize() -> Start initialization" << endl);
185 Cerr(
"***** oSensitivityGenerator::Initialize() -> Sensitivity for SPECT and CT not yet implemented !" << endl);
197 Cerr(
"***** oSensitivityGenerator::Initialize() -> A problem occured while initializing the normalization data files !" << endl);
203 Cerr(
"***** oSensitivityGenerator::Initialize() -> A problem occured while initializing the attenuation files !" << endl);
229 Cerr(
"***** oSensitivityGenerator::Initialize() -> Error during mask image initialization !" << endl);
263 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> Normalization correction is included in the data file while it is not in the sensitivity computation !" << endl);
272 if (
m_verbose>=2)
Cout(
"oSensitivityGenerator::InitializeNormalizationFiles() -> Initialize normalization files" << endl);
282 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> Number of normalization files options should be one or equal to the number of data files !" << endl);
314 vector<string> normalization_files;
316 int bed_data_file_name_index = bed;
321 while (comma!=string::npos)
342 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> Number of normalization files for bed " << bed+1 <<
" should be one or equal to the number of frames !" << endl);
349 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> If only one normalization file is provided for all frames, then it must be so for all beds !" << endl);
376 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> Unknown scanner type (" << p_ScannerManager->
GetScannerType() <<
") or not yet implemented !" << endl);
383 bool affect_quantification_flag =
false;
386 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> A problem occurred during normalization datafile header reading !" << endl);
391 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> A problem occurred while checking normalization datafile parameters !" << endl);
396 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> A problem occurred in normalization datafile event size computation !" << endl);
401 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> A problem occurred in normalization datafile initialization !" << endl);
406 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> A problem occured in normalization datafile preparation !" << endl);
412 Cerr(
"***** oSensitivityGenerator::InitializeNormalizationFiles() -> Normalization data file used for sensitivity computation must be either histogram or normalization mode !" << endl);
443 Cerr(
"***** oSensitivityGenerator::InitializeAttenuationFiles() -> Attenuation correction is included in the data file while it is not in the sensitivity computation !" << endl);
454 Cout(
"oSensitivityGenerator::InitializeAttenuationFiles() -> Ignore provided mumap and consider ACF provided in the normalization data file" << endl);
459 if (
m_verbose>=2)
Cout(
"oSensitivityGenerator::InitializeAttenuationFiles() -> Allocate and read attenuation images (assumed to be in cm-1)" << endl);
464 Cerr(
"***** oSensitivityGenerator::Initialize() -> A problem occured while initializing the attenuation image into the image space !" << endl);
499 if (
m_verbose>=1)
Cout(
"oSensitivityGenerator::Launch() -> Start the sensitivity computation" << endl);
528 Cerr(
"***** oSensitivityGenerator::LaunchCPU() -> A problem occured while computing the sensitivity using the histogram data file for bed " << bed+1 <<
" !" << endl);
537 Cerr(
"***** oSensitivityGenerator::LaunchCPU() -> A problem occured while computing the sensitivity using the normalization file for bed " << bed+1 <<
" !" << endl);
546 Cerr(
"***** oSensitivityGenerator::LaunchCPU() -> A problem occured while computing the sensitivity from scanner elements for bed " << bed+1 <<
" !" << endl);
551 MPI_Barrier(MPI_COMM_WORLD);
572 for (
int rg=0 ; rg<frm_nb_1st_mot_imgs ; rg++)
639 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile() -> Cannot compute sensitivity from histogram file with gating !" << endl);
647 else Cout(
"oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile() -> Start computation" << endl);
651 clock_t clock_start = clock();
652 time_t time_start = time(NULL);
655 bool problem =
false;
662 int64_t index_start = 0;
663 int64_t index_stop = 0;
670 int64_t index = 0, printing_index = 0;
671 #pragma omp parallel for private(index) schedule(static, 1)
672 for ( index = index_start ; index < index_stop ; index++)
677 th = omp_get_thread_num();
682 if (printing_index%1000==0)
684 int percent = ((int)( ((
FLTNB)(index-index_start)) * 100. / ((
FLTNB)(index_stop-index_start)) ));
685 cout <<
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b "
686 << percent <<
" % " << flush;
694 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile() -> An error occured while getting the event from index "
695 << index <<
" (thread " << th <<
") !" << endl);
715 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile() -> A problem occured while computing the projection line !" << endl);
724 int no_resp_gate = 0;
725 int no_card_gate = 0;
729 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile() -> A problem occured while processing a line !" << endl);
735 MPI_Barrier(MPI_COMM_WORLD);
740 cout <<
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
741 <<
" --> 100 % " << endl;
745 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromHistogramDataFile() -> A problem occured inside the parallel loop over events !" << endl);
750 clock_t clock_stop = clock();
751 time_t time_stop = time(NULL);
753 Cout(
" --> Time spent for sensitivity generation for bed " << a_bed+1 <<
" | User: " << time_stop-time_start
754 <<
" sec | CPU: " << (clock_stop-clock_start)/((
FLTNB)CLOCKS_PER_SEC) <<
" sec" << endl);
756 Cout(
" --> Time spent for sensitivity generation | User: " << time_stop-time_start
757 <<
" sec | CPU: " << (clock_stop-clock_start)/((
FLTNB)CLOCKS_PER_SEC) <<
" sec" << endl);
774 else Cout(
"oSensitivityGenerator::ComputeSensitivityFromNormalizationFile() -> Start computation" << endl);
778 clock_t clock_start = clock();
779 time_t time_start = time(NULL);
786 cout <<
" --> Processing frame " << fr+1 << endl;
792 cout <<
" --> Processing respiratory gate " << rg+1 << endl;
798 cout <<
" --> Processing cardiac gate " << cg+1 << endl;
810 bool problem =
false;
817 int64_t index_start = 0;
818 int64_t index_stop = 0;
822 uint64_t progression_index_total = (index_stop-index_start)
828 int64_t index = 0, printing_index = 0;
829 #pragma omp parallel for private(index) schedule(static, 1)
830 for ( index = index_start ; index < index_stop ; index++)
835 th = omp_get_thread_num();
854 if (printing_index%1000==0)
856 int64_t progression_chunk = (int64_t)((
FLTNB)(index_stop-index_start));
859 + cg * progression_chunk
862 int64_t percent = (int64_t) (( ((
FLTNB)progression_index_current)/((
FLTNB)progression_index_total) ) * ((
FLTNB)100));
863 cout <<
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b "
864 << percent <<
" % " << flush;
874 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromNormalizationFile() -> An error occured while getting the event from index "
875 << index <<
" (thread " << th <<
") !" << endl);
885 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromNormalizationFile() -> A problem occured while computing the projection line !" << endl);
894 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromNormalizationFile() -> A problem occured while processing a line !" << endl);
899 cout <<
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
900 <<
" --> 100 % " << endl;
904 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromNormalizationFile() -> A problem occured inside the parallel loop over events !" << endl);
912 clock_t clock_stop = clock();
913 time_t time_stop = time(NULL);
915 Cout(
" --> Time spent for sensitivity generation for bed " << a_bed+1 <<
" | User: " << time_stop-time_start
916 <<
" sec | CPU: " << (clock_stop-clock_start)/((
FLTNB)CLOCKS_PER_SEC) <<
" sec" << endl);
918 Cout(
" --> Time spent for sensitivity generation | User: " << time_stop-time_start
919 <<
" sec | CPU: " << (clock_stop-clock_start)/((
FLTNB)CLOCKS_PER_SEC) <<
" sec" << endl);
939 else Cout(
"oSensitivityGenerator::ComputeSensitivityFromScanner() -> Start computation" << endl);
949 clock_t clock_start = clock();
950 time_t time_start = time(NULL);
953 int64_t main_loop_start_index = 0 ;
954 int64_t main_loop_stop_index = 0;
960 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromScanner() -> An error occured when trying to initialize main loop stop index !" << endl);
965 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromScanner() -> An error occured when trying to initialize inner loop start index !" << endl);
971 int64_t* progression_elts_array =
new int64_t[nb_total_elts*
sizeof(int64_t)];
972 progression_elts_array[0] = 0;
977 uint64_t printing_index = 0;
993 cout <<
" --> Processing frame " << fr+1 << endl;
997 for (
int rg=0 ; rg<frm_nb_1st_mot_imgs ; rg++)
1001 cout <<
" --> Processing respiratory gate " << rg+1 << endl;
1007 cout <<
" --> Processing cardiac gate " << cg+1 << endl;
1034 bool problem =
false;
1043 #pragma omp parallel for private(idx_elt1) schedule(static, 1)
1044 for(idx_elt1=main_loop_start_index ; idx_elt1<main_loop_stop_index ; idx_elt1++)
1049 th = omp_get_thread_num();
1057 for (int64_t idx_elt2=inner_loop_start_index ; idx_elt2<inner_loop_stop_index ; idx_elt2++)
1062 if (
m_verbose>=2 && printing_index%10000==0)
1068 int64_t percent = (int64_t) (( ((
FLTNB)progression_index_current)/((
FLTNB)progression_index_total) ) * ((
FLTNB)100));
1069 cout <<
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b "
1070 << percent <<
" % ";
1085 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromScanner() -> A problem occured while computing the projection line !" << endl);
1095 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromScanner() -> A problem occured while processing a line !" << endl);
1101 cout <<
"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
1102 <<
" --> 100 % " << endl;
1106 Cerr(
"***** oSensitivityGenerator::ComputeSensitivityFromScanner() -> A problem occured inside the parallel loop over events !" << endl);
1114 delete[] progression_elts_array;
1117 clock_t clock_stop = clock();
1118 time_t time_stop = time(NULL);
1120 Cout(
" --> Time spent for sensitivity generation for bed " << a_bed+1 <<
" | User: " << time_stop-time_start
1121 <<
" sec | CPU: " << (clock_stop-clock_start)/((
FLTNB)CLOCKS_PER_SEC) <<
" sec" << endl);
1123 Cout(
" --> Time spent for sensitivity generation | User: " << time_stop-time_start
1124 <<
" sec | CPU: " << (clock_stop-clock_start)/((
FLTNB)CLOCKS_PER_SEC) <<
" sec" << endl);
1146 if (multiplicative_factor<=0.)
return 0;
1150 if (quantification_factor<=0.)
return 0;
1157 FLTNB attenuation_correction_factor = 1.;
1163 FLTNB cumulative_mu = 0.;
1172 attenuation_correction_factor = max(((
FLTNB)1.),exp(cumulative_mu*((
FLTNB)0.1)));
1180 FLTNB lor_sensitivity = 1. / (quantification_factor * attenuation_correction_factor * multiplicative_factor);
1211 merge_dynamic_files )
oImageSpace * mp_ImageSpace
int ApplyMaskToBackwardImage(int a_imageIndex, int a_timeIndex, int a_respIndex, int a_cardIndex)
Apply the mask to the backward image matrix of the first thread for the specific image / time / respi...
oImageConvolverManager * mp_ImageConvolverManager
FLTNB **** m4p_forwardImage
This class is designed to be a mother virtual class for DataFile.
This header file is mainly used to declare some macro definitions and all includes needed from the st...
bool GetNormCorrectionFlag()
Simply return m_normCorrectionFlag.
oProjectorManager * mp_ProjectorManager
static sScannerManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
void GetEventIndexStartAndStop(int64_t *ap_indexStart, int64_t *ap_indexStop, int a_subsetNum=0, int a_NbSubsets=1)
Compute the index start and stop of the events loop with respect to the current subset and MPI size a...
int ProcessThisLine(oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_frame, int a_respGate, int a_cardGate, int a_thread)
This function manages the computation of the sensitivity contribution of the projection line provided...
void LMS_CopyAtnToForwardImage(bool a_use1stMotion, bool a_use2ndMotion)
Copy the attenuation image contained in the 'm2p_attenuation' matrix inside the m4p_forwardImage matr...
int64_t PROJ_GetModalityStartValueInnerLoop(int64_t a_elt1)
Get the start value for the inner loop of analytic projection depending on the modality.
#define MODE_NORMALIZATION
int InitMaskImage(const string &a_pathToImage)
Memory allocation and initialization for the mask image.
oSensitivityGenerator()
The constructor of oSensitivityGenerator.
int Initialize()
A public function used to initialize the sensitivity generator.
int LMS_SaveSensitivityImage(const string &a_pathToSensitivityImage, oDeformationManager *ap_DeformationManager)
Call the interfile function to write the sensitivity image on disk.
bool m_oneNormalizationFileForAllBeds
int m_nbAtnRespGateImages
vDataFile *** m3p_NormalizationDataFile
int GetNb1stMotImgsForLMS(int a_fr)
call the eponym function from the oDynamicDataManager object
oDeformationManager * mp_DeformationManager
string GetPathToSensitivityImage()
This function return the path to the sensitivity image.
int64_t PROJ_GetProgressionFinalValue()
Get numerator value according to the modality to compute percent progression during the projection pr...
int GetPMotionFirstIndexForLMS(int a_fr)
bool m_oneNormalizationFileForAllFrames
void SetVerbose(int a_verboseLevel)
set verbosity
bool GetIgnoreAttnCorrectionFlag()
Get the boolean that says if the attenuation correction is ignored or not.
~oSensitivityGenerator()
The destructor of oSensitivityGenerator.
int Launch()
A public function used to launch the sensitivity generator (compute the sensitivity image) ...
virtual FLTNB GetMultiplicativeCorrections()=0
This is a pure virtual function implemented in the child classes.
void LMS_InstantiateForwardImage()
Allocate memory for the forward image matrices (for list-mode sensitivity generation) ...
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
int InitAttenuationImage(const string &a_pathToAtnImage)
Memory allocation and initialisation for the attenuation image using either :
Declaration of class iDataFilePET.
void DeallocateMaskImage()
Free memory for the mask image.
bool GetIgnoreNormCorrectionFlag()
Get the boolean that says if the normalization correction is ignored or not.
vEvent * GetEvent(int64_t a_eventIndex, int a_th=0)
INTNB GetVoxelIndex(int a_direction, int a_TOFBin, INTNB a_voxelInLine)
This function is used to get the contributing voxel index of the provided direction, TOF bin and voxel rank.
bool m_computeFromHistogramFlag
const string & GetPathName()
FLTNB ****** m6p_backwardImage
bool m_inverseDataFileOrderFlag
int m_nbAtnCardGateImages
Singleton class that manages output writing on disk (images, sinograms, etc). It also manages loggi...
int ComputeSensitivityFromNormalizationFile(int a_bed)
Launch the computation of the sensitivity image for this bed, based on normalization data files...
void LMS_DeallocateSensitivityImage()
Free memory for the sensitivity image matrices (for list-mode sensitivity generation) ...
int GetNbBeds()
Get the number of bed positions.
Singleton class that Instantiate and initialize the scanner object.
void ResetCurrentDynamicIndices()
Call the eponym function from the oDynamicDataManager class using the member object.
INTNB GetCurrentNbVoxels(int a_direction, int a_TOFBin)
This function is used to get the current number of contributing voxels to the line.
uint64_t * mp_lineCounter
oProjectionLine * ComputeProjectionLine(vEvent *ap_Event, int a_th)
This function is used to compute system matrix elements from the associated projector or pre-computed...
FLTNB GetQuantificationFactor(int a_bed, int a_frame, int a_respGate, int a_cardGate)
Get the quantification factor corresponding to the provided bed, frame, respiratory and cardiac gates...
int InitializeAttenuationFiles()
Initialize the attenuation images provided for sensitivity computation.
void SetHeaderDataFileName(const string &a_headerFileName)
set the data header file name
void ApplyBedOffset(int a_bed)
Compute the bed offset from the provided bed index and apply it to all projection lines...
vEvent * PROJ_GenerateEvent(int idx_elt1, int idx_elt2, int a_th)
Generate a standard event and set up its ID Used by the projection, list-mode sensitivity generatio...
bool NotEmptyLine()
This function is used to know if the line contains any voxel contribution.
int LaunchCPU()
Launch the computation of the sensitivity image (CPU version)
bool m_forwardProjectAttenuation
bool m_mumapAttenuationFlag
virtual int GetSystemNbElts()=0
This is a pure virtual method that must be implemented by children.
vDataFile ** m2p_DataFile
void ReduceBackwardImage(int a_imageIndex, int a_timeIndex, int a_respIndex, int a_cardIndex)
Merge parallel results into the backward image matrix of the first thread for the specific image / ti...
This class is designed to manage and store system matrix elements associated to a vEvent...
const string & GetBaseName()
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
string m_pathToSensitivityImage
void InstantiateBackwardImageFromDynamicBins()
Allocate memory for the backward image matrices and initialize them.
Declaration of class oSensitivityGenerator.
void LMS_DeallocateAttenuationImage()
Free memory for the Attenuation image matrices (for analytical projection or list-mode sensitivity ge...
int GetNbCardGates()
Get the number of cardiac gates.
bool MergeDynImages()
Indicate if a dynamic serie of 3D images should be merged in one file (true) or written on disk as on...
void SetBedIndex(int a_bedIndex)
set the bed index corresponding to this data file
Mother class for the Event objects.
int GetNbThreadsForImageComputation()
Get the number of threads used for image operations.
int GetNbTimeFrames()
Get the number of time frames.
int GetNb2ndMotImgsForLMS()
call the eponym function from the oDynamicDataManager object
string m_pathToAttenuationImage
int InitializeNormalizationFiles()
Initialize the normalization datafiles provided for sensitivity computation.
int CheckParameters()
A public function used to check the parameters settings.
int64_t PROJ_GetCurrentProgression(int64_t a_elt1, int64_t a_elt2, int64_t *ap_nbEltsArray, int a_nbRGates, int a_nbCGates, int a_fr, int a_rg, int a_cg)
Get numerator value according to the modality to compute percent progression during the analytical pr...
int GetNbTOFBins()
This function is used to get the number of TOF bins in use.
int GetNbThreadsForProjection()
Get the number of threads used for projections.
FLTNB GetVoxelWeights(int a_direction, int a_TOFBin, INTNB a_voxelInLine)
This function is used to get the contributing voxel weight of the provided direction, TOF bin and voxel rank.
vector< string > mp_pathToNormalizationFileName
int ComputeSensitivityFromHistogramDataFile(int a_bed)
Launch the computation of the sensitivity image for this bed, based on the input histogram data files...
int GetNbRespGates()
Get the number of respiratory gates.
int64_t PROJ_GetModalityStopValueMainLoop()
Get the stop value for the main loop of analytic projection depending on the modality.
int ConvolveSensitivity(oImageSpace *ap_ImageSpace)
A function used to apply convolvers onto the sensitivity image of the oImageSpace.
virtual int IsAvailableLOR(int a_elt1, int a_elt2)
This function is implemented in child classes. Check if the LOR is available according to the scann...
int ComputeSensitivityFromScanner(int a_bed)
Launch the computation of the sensitivity image for this bed, based on a loop over all scanner elemen...
bool GetAtnCorrectionFlag()
Simply return m_atnCorrectionFlag.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
set the pointer to the oImageDimensionsAndQuantification object
void DeallocateBackwardImageFromDynamicBins()
Free memory of the backward image matrices.
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data)...
void LMS_InstantiateSensitivityImage()
Allocate memory for the sensitivity image matrices (for list-mode sensitivity generation) ...
int GetMPIRank()
Get the MPI instance number (the rank)
void LMS_CopyBackwardToSensitivity()
void LMS_DeallocateForwardImage()
Free memory for the forward image matrices (for list-mode sensitivity generation) ...