83 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateImage() -> Initialize to 0."<< endl);
122 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateImage() -> Free memory"<< endl);
152 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateForwardImage() -> Initialize to 0."<< endl);
191 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateForwardImage() -> Free memory"<< endl);
222 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateBackwardImageFromDynamicBasis() -> Initialize to 0."<< endl);
270 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateBackwardImageFromDynamicBasis() -> Free memory" << endl);
310 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateBackwardImageFromDynamicBins() -> Initialize to 0."<< endl);
349 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateBackwardImageFromDynamicBins() -> Free memory"<< endl);
395 if (!a_pathToSensitivityImage.empty())
398 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateSensitivityImage() -> Will be loaded from '" << a_pathToSensitivityImage <<
"'" << endl);
429 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateSensitivityImage() -> For all threads"<< endl);
467 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateSensitivityImage() -> Free memory"<< endl);
563 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMiscellaneousImage() -> Free memory"<< endl);
582 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateVisitedVoxelsImage ..."<< endl);
594 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateVisitedVoxelsImage ..."<< endl);
607 if (!a_pathToImage.empty())
616 if (
m_verbose>=3)
Cout(
"oImageSpace::InitMultiModalImage() -> From file '" << a_pathToImage.at(nb) <<
"'"<< endl);
618 ifstream image_file(a_pathToImage.at(nb).c_str(), ios::in|ios::binary);
619 if (!image_file.is_open())
621 Cerr(
"***** oImageSpace::InitMultiModalImage() -> Input file '" << a_pathToImage.at(nb) <<
"' is missing or corrupted !" << endl);
630 Cerr(
"***** oImageSpace::InitMultiModalImage() -> Error reading interfile image '" << a_pathToImage.at(nb) <<
"' !" << endl);
657 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMultiModalImage() -> Free memory" << endl);
673 if (!a_pathToImage.empty())
676 if (
m_verbose>=3)
Cout(
"oImageSpace::InitMaskImage() -> From file '" << a_pathToImage <<
"'"<< endl);
678 ifstream image_file(a_pathToImage.c_str(), ios::in|ios::binary);
679 if (!image_file.is_open())
681 Cerr(
"***** oImageSpace::InitMaskImage() -> Input file '" << a_pathToImage <<
"' is missing or corrupted !" << endl);
692 Cerr(
"***** oImageSpace::InitMaskImage() -> Error reading interfile image '" << a_pathToImage <<
"' !" << endl);
717 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMaskImage() -> Free memory" << endl);
742 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateOutputImage ..."<< endl);
789 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateOutputImage ..."<< endl);
869 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateRefImagesForDeformation ..."<< endl);
981 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateRefImagesForDeformation ..."<< endl);
1107 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateAttenuationImage ..."<< endl);
1141 if (a_pathToAtnImage.empty())
return 0;
1143 if (
m_verbose>=
VERBOSE_NORMAL)
Cout(
"oImageSpace::InitAttenuationImage() -> Initialize and read attenuation image from file '" << a_pathToAtnImage <<
"'"<< endl);
1162 ifstream image_file(a_pathToAtnImage.c_str(), ios::in|ios::binary);
1164 if (!image_file.is_open())
1166 Cerr(
"***** oImageSpace::InitAttenuationImage() -> Failed to open attenuation image from file '" << a_pathToAtnImage <<
"' !" << endl);
1174 Cerr(
"***** oImageSpace::InitAttenuationImage() -> An error occurred while reading from file '" << a_pathToAtnImage <<
"' !" << endl);
1181 int nb_atn_frames = 1, nb_atn_rgates = 1, nb_atn_cgates = 1;
1187 Cerr(
"***** oImageSpace::InitAttenuationImage() -> An error occurred while reading'number of time frames', 'number of respiratory gates' or 'number of cardiac gates' keys from file '" << a_pathToAtnImage <<
"' !" << endl);
1248 if (!a_pathToInitialImage.empty())
1252 Cerr(
"***** oImageSpace::InitImage()-> Error while trying to read file at " << a_pathToInitialImage << endl);
1261 FLTNB exterior_fov_value = a_value * 1.;
1267 squared_radius_x *= squared_radius_x;
1269 squared_radius_y *= squared_radius_y;
1276 #pragma omp parallel for private(x) schedule(guided) 1281 squared_distance_x *= squared_distance_x;
1287 squared_distance_y *= squared_distance_y;
1289 FLTNB affected_value = 0.;
1291 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. ) affected_value = a_value;
1293 else affected_value = exterior_fov_value;
1304 m4p_image[tbf][rbf][cbf][index] = affected_value;
1328 if(
m_verbose>=3)
Cout(
"oImageSpace::LoadInitialImage ..."<< endl);
1330 ifstream image_file;
1331 image_file.open(a_pathToImage.c_str(), ios::in | ios::binary);
1333 if(!image_file.is_open())
1335 Cerr(
"***** oImageSpace::LoadInitialImage()-> Error reading file!" << endl);
1344 Cerr(
"***** oImageSpace::LoadInitialImage()-> Error reading Interfile : " << a_pathToImage <<
" !" << endl);
1366 if(
m_verbose>=3)
Cout(
"oImageSpace::InitBackwardImage ..." << endl);
1372 #pragma omp parallel for private(th) schedule(static, 1) 1387 #pragma omp parallel for private(th) schedule(static, 1) 1418 if(
m_verbose>=3)
Cout(
"oImageSpace::InitSensitivityImage ..."<< endl);
1425 if (!a_pathToSensitivityImage.empty())
1428 ifstream input_file;
1429 input_file.open(a_pathToSensitivityImage.c_str(), ios::binary | ios::in);
1431 if (input_file.is_open())
1436 Cerr(
"***** oImageSpace::InitSensitivityImage()-> Error reading Interfile : " << a_pathToSensitivityImage <<
" !" << endl);
1444 Cerr(
"***** oImageSpace::InitSensitivityImage() -> Input sensitivity file '" << a_pathToSensitivityImage <<
"' is missing or corrupted !" << endl);
1488 if(
m_verbose>=3)
Cout(
"oDeformationManager::InitBwdImageForDeformation ..." << endl);
1557 if(
m_verbose>=3)
Cout(
"oImageSpace::ComputeOutputImage ..."<< endl);
1570 #pragma omp parallel for private(v) schedule(guided) 1578 if (time_basis_coef==0.)
continue;
1584 if (resp_basis_coef==0.)
continue;
1590 if (card_basis_coef==0.)
continue;
1592 FLTNB global_basis_coeff = time_basis_coef * resp_basis_coef * card_basis_coef;
1594 #pragma omp parallel for private(v) schedule(guided) 1624 Cout(
"oImageSpace::ApplyOutputFlip() -> Flip image" << endl);
1669 INTNB indice_1 = base_z1 + base_y + x;
1670 INTNB indice_2 = base_z2 + base_y + x;
1704 INTNB indice_1 = base_z + base_y1 + x;
1705 INTNB indice_2 = base_z + base_y2 + x;
1738 INTNB indice_1 = base_z + base_y + x_1;
1739 INTNB indice_2 = base_z + base_y + x_2;
1776 Cout(
"oImageSpace::ApplyOutputFOVMasking() -> Mask output image" << endl);
1791 squared_radius_x *= squared_radius_x;
1794 squared_radius_y *= squared_radius_y;
1801 #pragma omp parallel for private(x) schedule(guided) 1806 squared_distance_x *= squared_distance_x;
1812 squared_distance_y *= squared_distance_y;
1814 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. )
continue;
1868 for (
int z=0; z<removed_slices; z++)
1875 INTNB index = base_z_first + i;
1884 INTNB index = base_z_last + i;
1909 Cout(
"oImageSpace::ApplyOutputMaskImage() -> Mask output image with the provided input mask image" << endl);
1915 #pragma omp parallel for private(v) schedule(guided) 1946 Cout(
"oImageSpace::ApplyMaskToSensitivity() -> Mask the sensitivity image with the provided input mask image" << endl);
1953 #pragma omp parallel for private(v) schedule(guided) 1984 Cout(
"oImageSpace::ApplyMaskToBackwardImage() -> Mask the backward image with the provided input mask image" << endl);
1991 #pragma omp parallel for private(v) schedule(guided) 2022 if (
m_verbose>=3)
Cout(
"oImageSpace::SaveOutputImage ..."<< endl);
2031 if (a_iteration >= 0)
2033 stringstream ss; ss << a_iteration + 1;
2034 path_to_img.append(
"_it").append(ss.str());
2040 stringstream ss; ss << a_subset + 1;
2041 path_to_img.append(
"_ss").append(ss.str());
2048 Cerr(
"***** oImageSpace::SaveOutputImage()-> Error writing Interfile of output image !" << endl);
2063 if (
m_verbose>=3)
Cout(
"oImageSpace::SaveOutputBasisCoefficientImage ..."<< endl);
2072 if (a_iteration >= 0)
2074 stringstream ss; ss << a_iteration + 1;
2075 path_to_img.append(
"_it").append(ss.str());
2081 stringstream ss; ss << a_subset + 1;
2082 path_to_img.append(
"_ss").append(ss.str());
2088 Cerr(
"***** oImageSpace::SaveOutputImage()-> Error writing Interfile of output image !" << endl);
2110 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveDebugImage ..."<< endl);
2113 ofstream output_file;
2114 output_file.open(a_name.c_str(), ios::binary | ios::out);
2123 output_file.close();
2142 if(
m_verbose>=3)
Cout(
"oImageSpace::PrepareForwardImage ..."<< endl);
2165 #if defined(CASTOR_OMP) || defined(CASTOR_MPI) 2166 if (
m_verbose>=3)
Cout(
"oImageSpace::Reduce() -> Merge parallel results" << endl);
2182 int alternative = 2;
2197 else if (alternative==2)
2200 #pragma omp parallel for private(v) schedule(guided) 2223 else if (alternative==2)
2226 #pragma omp parallel for private(v) schedule(guided) 2282 if(
m_verbose>=3)
Cout(
"oImageSpace::CleanNeverVisitedVoxels ..."<< endl);
2285 #pragma omp parallel for private(v) schedule(guided) 2321 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateImage ..."<< endl);
2353 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateImage ..."<< endl);
2384 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateForwardImage ..."<< endl);
2418 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateForwardImage ..."<< endl);
2450 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateSensitivityImage ..."<< endl);
2480 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateSensitivityImage ..."<< endl);
2514 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyAtnToImage ..."<< endl);
2549 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyAtnToForwardImage ..."<< endl);
2557 int rg_atn = a_use1stMotion ? 0 : rg ;
2558 int cg_atn = a_use1stMotion ? 0 : cg ;
2586 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyBackwardToSensitivity ..."<< endl);
2606 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_PrepareForwardImage ..."<< endl);
2625 #if defined(CASTOR_OMP) || defined(CASTOR_MPI) 2626 if (
m_verbose>=3)
Cout(
"oImageSpace::ReduceBackwardImage() -> Merge parallel results" << endl);
2674 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_SaveSensitivityImage ..."<< endl);
2688 nb_reco_card_images = 1;
2709 for (
int cg=0 ; cg<nb_reco_card_images ; cg++)
2738 FLTNB sensitivity_value_avg = 0.;
2755 Cerr(
"***** oImageSpace::LMS_SaveSensitivityImage()-> Error writing Sensitivity image !" << endl);
2777 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveSensitivityImage ..."<< endl);
2781 Cerr(
"***** oImageSpace::SaveSensitivityImage()-> Error writing Interfile of output image !" << endl);
2806 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_InstantiateProjectionImage ..."<< endl);
2810 for(
int p=0 ; p<a_nbProjs ; p++)
2813 for(
int px=0 ; px<a_nbPixels ; px++)
2834 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_DeallocateProjectionImage ..."<< endl);
2836 for(
int p=0 ; p<a_nbProjs ; p++)
2860 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_InitImage ..."<< endl);
2862 if (!a_pathToInitialImage.empty())
2866 Cerr(
"***** oImageSpace::PROJ_InitImage()-> Error while trying to read file at " << a_pathToInitialImage << endl);
2873 Cerr(
"***** oImageSpace::PROJ_InitImage()-> No projected image provided ! " << endl);
2895 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_LoadInitialImage ..."<< endl);
2897 ifstream image_file;
2898 image_file.open(a_pathToImage.c_str(), ios::in | ios::binary);
2900 if(!image_file.is_open())
2902 Cerr(
"***** oImageSpace::PROJ_LoadInitialImage()-> Error reading file !" << endl);
2910 Cerr(
"***** oImageSpace::PROJ_LoadInitialImage()-> Error reading Interfile : " << a_pathToImage <<
" !" << endl);
2936 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_SaveProjectionImage ..."<< endl);
2938 string img_name =
"_ProjectionImage";
2955 uint16_t nb_projs, nb_heads;
2957 uint16_t nb_bins[2];
2973 Img_fields.
mtx_size[0] = nb_bins[0];
2974 Img_fields.
mtx_size[1] = nb_bins[1];
2975 Img_fields.
vox_size[0] = pix_size[0];
2976 Img_fields.
vox_size[1] = pix_size[1];
2990 string angles_str =
"{";
2991 string radius_str =
"{";
2994 bool has_single_radius =
true;
2996 for(uint16_t p=0 ; p<nb_projs ; p++)
2998 stringstream ss_a, ss_r;
3000 ss_a << p_angles[p];
3001 angles_str.append(ss_a.str());
3002 (p<nb_projs-1) ? angles_str.append(
",") : angles_str.append(
"}");
3005 ss_r << p_radius[p];
3006 radius_str.append(ss_r.str());
3007 (p<nb_projs-1) ? radius_str.append(
",") : radius_str.append(
"}");
3008 if(p_radius[p] != p_radius[0])
3009 has_single_radius =
false;
3016 angles_str.append(
"\n");
3017 radius_str.append(
"\n");
3022 if(has_single_radius)
3026 radius_str = ss.str();
3030 Img_fields.
radius = radius_str;
3036 img_file_name.append(
"_ProjImage");
3040 Cerr(
"***** oImageSpace::PROJ_SaveProjectionImage()-> Error writing Interfile of output image !" << endl);
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...
#define INTF_LERP_DISABLED
FLTNB **** m4p_forwardImage
void LMS_InstantiateImage()
Allocate memory for the main image matrices (for list-mode sensitivity generation) ...
static sScannerManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
void DeallocateMiscellaneousImage()
Deallocate all allocated miscellaneous images.
FLTNB ** m2p_projectionImage
string direction_rotation
FLTNB **** m4p_refDynForwardImage
void DeallocateBackwardImageFromDynamicBasis()
Free memory for the backward image matrices.
void LMS_CopyAtnToForwardImage(bool a_use1stMotion, bool a_use2ndMotion)
Copy the attenuation image contained in the 'm2p_attenuation' matrix inside the m4p_forwardImage matr...
int GetNbCardBasisFunctions()
Get the number of cardiac basis functions.
#define INTF_LERP_ENABLED
int InitMaskImage(const string &a_pathToImage)
Memory allocation and initialization for the mask image.
int PROJ_InitImage(const string &a_pathToInitialImage)
Load the initial image for the analytical projection.
FLTNB GetVoxSizeX()
Get the voxel's size along the X axis, in mm.
int ApplyOutputMaskImage()
Mask the outside of the provided input mask image.
void DeallocateImage()
Free memory for the main image matrices.
int LMS_SaveSensitivityImage(const string &a_pathToSensitivityImage, oDeformationManager *ap_DeformationManager)
Call the interfile function to write the sensitivity image on disk.
void LMS_PrepareForwardImage()
Copy current image in forward-image buffer (for list-mode sensitivity generation) ...
FLTNB GetFOVOutPercent()
Get the percentage of transaxial unmasked FOV.
int GetNb1stMotImgsForLMS(int a_fr)
call the eponym function from the oDynamicDataManager object
void Reduce()
Merge parallel results into the matrix of the backward image matrix of the first thread. Also for MPI.
int InitMultiModalImage(const vector< string > &a_pathToMultiModalImage)
Memory allocation and initialization for the multimodal image matrices.
FLTNB GetRespBasisCoefficient(int a_respBasisFunction, int a_respGate)
Get the respiratory basis coefficients for the provided respiratory gate and basis function...
int ApplyOutputFOVMasking()
Mask the outside of the transaxial FOV based on the m_fovOutPercent.
void DeallocateMultiModalImage()
Free memory for the multimodal image.
~oImageSpace()
oImageSpace destructor.
FLTNB ***** m5p_refDynBackwardImage
void DeallocateSensitivityImage()
Free memory for the sensitivity image matrices.
void InstantiateImage()
Allocate memory for the main image matrices.
int IntfKeyGetValueFromFile(const string &a_pathToHeader, const string &a_key, T *ap_return, int a_nbElts, int a_mandatoryFlag)
Look for "a_nbElts" elts in the "a_pathToHeader" interfile header matching the "a_keyword" key passed...
int PROJ_SaveProjectionImage()
Save an image of the projected data (for analytic projection)
void InstantiateBackwardImageFromDynamicBasis(int a_nbBackwardImages)
Allocate memory for the backward image matrices and set the number of backward images for the whole c...
int GetNbMultiModalImages()
Get the number of additional multimodal images.
int ApplyMaskToSensitivity()
Apply the mask to the sensitivity image (only for the first thread, the image must be reduced beforeh...
int GetNbTimeBasisFunctions()
Get the number of time basis functions.
void LMS_InstantiateForwardImage()
Allocate memory for the forward image matrices (for list-mode sensitivity generation) ...
void InstantiateSensitivityImage(const string &a_pathToSensitivityImage)
Allocate the sensitivity image matrices.
int GetSPECTSpecificParameters(uint16_t *ap_nbOfProjections, uint16_t *ap_nbHeads, FLTNB *ap_acquisitionZoom, uint16_t *ap_nbOfBins, FLTNB *ap_pixSizeXY, FLTNB *&ap_angles, FLTNB *&ap_CORtoDetectorDistance, int *ap_headRotDirection)
Transfer geometric information recovered from the datafile to the scanner object. ...
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
FLTNB **** m4p_refDynSensitivityImage
oImageDimensionsAndQuantification * mp_ID
void LMS_CopyAtnToImage()
Copy the attenuation image contained in the 'm2p_attenuation' matrix inside the m2p_image matrix...
int InitAttenuationImage(const string &a_pathToAtnImage)
Memory allocation and initialisation for the attenuation image using either :
int InitImage(const string &a_pathToInitialImage, FLTNB a_value)
Initialize the main image, either using:
void DeallocateVisitedVoxelsImage()
Free memory for the image matrix containing binary information regarding which 3D voxels have been vi...
void SaveDebugImage(const string &a_name)
Just a debug function dedicated to write any kind of image on disk in raw format, for debugging purpo...
void DeallocateMaskImage()
Free memory for the mask image.
bool GetRespStaticFlag()
Get the respiratory static flag that says if the reconstruction has only one respiratory gate or not...
int PROJ_LoadInitialImage(const string &a_pathToImage)
Load the initial image for the analytical projection.
FLTNB * mp_visitedVoxelsImage
void PROJ_DeallocateProjectionImage(int a_nbProjs)
Free memory for the projection image for analytical projection.
void PrepareForwardImage()
Copy current image matrix in the forward-image buffer matrix.
FLTNB GetVoxSizeY()
Get the voxel's size along the Y axis, in mm.
int SaveOutputBasisCoefficientImage(int a_iteration, int a_subset=-1)
Call the interfile function to write output basis function coefficient image on disk.
const string & GetPathName()
FLTNB ****** m6p_backwardImage
bool GetCardStaticFlag()
Get the cardiac static flag that says if the reconstruction has only one cardiac gate or not...
void InstantiateVisitedVoxelsImage()
Memory allocation and initialization for the image matrix containing binary information regarding whi...
void InitRefImagesForDeformation()
void CleanNeverVisitedVoxels()
Based on the visitedVoxelsImage, clean the never visited voxels in the image. This function must be c...
Singleton class that manages output writing on disk (images, sinograms, etc). It also manages loggi...
void LMS_DeallocateSensitivityImage()
Free memory for the sensitivity image matrices (for list-mode sensitivity generation) ...
FLTNB ** m2p_multiModalImage
Singleton class that Instantiate and initialize the scanner object.
int SaveOutputImage(int a_iteration, int a_subset=-1)
Call the interfile function to write output image on disk.
void LMS_DeallocateImage()
Free memory for the main image matrices (for list-mode sensitivity generation)
Declaration of class vOptimizer.
void ComputeOutputImage()
int LoadInitialImage(const string &a_pathToImage)
Load the initial image provided by the user in the corresponding matrix.
FLTNB **** m4p_outputImage
void DeallocateRefImagesForDeformation()
Free memory for the buffer sensitivity image required for image-based deformation. This function is called from the Deformation Manager.
INTNB GetNbVoxXY()
Get the number of voxels in a slice.
FLTNB ** m2p_miscellaneousImage
FLTNB GetTimeBasisCoefficient(int a_timeBasisFunction, int a_timeFrame)
Get the time basis coefficients for the provided frame and basis function.
void InstantiateForwardImage()
Allocate memory for the forward image matrices.
bool GetTimeStaticFlag()
Get the time static flag that says if the reconstruction has only one frame or not.
void PROJ_InstantiateProjectionImage(int a_nbProjs, int a_nbPixels)
Instanciate and initialize projection image for analytical projection.
bool GetFlipOutX()
Get the boolean saying if the output image must be flipped along the X axis.
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...
bool GetFlipOutY()
Get the boolean saying if the output image must be flipped along the Y axis.
const string & GetBaseName()
int ApplyOutputFlip()
Just flip the output image.
void InstantiateBackwardImageFromDynamicBins()
Allocate memory for the backward image matrices and initialize them.
Declaration of class oImageSpace.
int IntfWriteProjFile(const string &a_pathToImg, FLTNB **a2p_ImgMatrix, oImageDimensionsAndQuantification *ap_ID, Intf_fields a_Imgfields, int vb)
Function dedicated to Interfile image writing for projected data.
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.
void DeallocateOutputImage()
Free memory for the Image matrices dedicated to output writing on disk.
Interfile fields. This structure contains all the Interfile keys currently managed by CASToR Decl...
uint16_t nb_detector_heads
int GetNbThreadsForImageComputation()
Get the number of threads used for image operations.
int GetNbTimeFrames()
Get the number of time frames.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
int GetNb2ndMotImgsForLMS()
call the eponym function from the oDynamicDataManager object
FLTNB * AllocateMiscellaneousImage()
Allocate a new miscellaneous image on m2p_miscellaneousImages and return the pointer to this image...
int GetNbThreadsForProjection()
Get the number of threads used for projections.
oImageSpace()
oImageSpace constructor. Initialize the member variables to their default values. ...
void IntfKeySetFieldsOutput(Intf_fields *ap_IF, oImageDimensionsAndQuantification *ap_ID)
Init the keys of the Interfile header of an image to be written on disk.
int IntfWriteWholeDynBasisCoeffImgFile(const string &a_pathToImg, FLTNB ****a4p_ImgMatrix, oImageDimensionsAndQuantification *ap_ID, int vb)
Main function dedicated to Interfile 6D (dynamic dims + 3D ) image writing of basis function coeffici...
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
int GetNbRespGates()
Get the number of respiratory gates.
FLTNB **** m4p_attenuation
void InstantiateRefImagesForDeformation()
Allocate memory for the buffer sensitivity image required for image-based deformation. This function is called from the Deformation Manager.
int m_nbMiscellaneousImages
int SaveSensitivityImage(const string &a_pathToSensitivityImage)
Call the interfile function to write the sensitivity image on disk.
bool GetFlipOutZ()
Get the boolean saying if the output image must be flipped along the Z axis.
void DeallocateBackwardImageFromDynamicBins()
Free memory of the backward image matrices.
void InitBackwardImage()
Initialize each voxel of the backward images to 0, also for sensitivity if not loaded (estimated on t...
int InitSensitivityImage(const string &a_pathToSensitivityImage)
Initialization for the sensitivity image matrices.
void LMS_InstantiateSensitivityImage()
Allocate memory for the sensitivity image matrices (for list-mode sensitivity generation) ...
void DeallocateForwardImage()
Free memory for the forward image matrices.
int IntfReadImage(const string &a_pathToHeaderFile, FLTNB *ap_ImgMatrix, oImageDimensionsAndQuantification *ap_ID, int vb, bool a_lerpFlag)
Main function dedicated to Interfile 3D image loading.
int GetNbRespBasisFunctions()
Get the number of respiratory basis functions.
int IntfWriteImgFile(const string &a_pathToImg, FLTNB *ap_ImgMatrix, const Intf_fields &ap_IntfF, int vb)
Main function dedicated to Interfile 3D image writing. Recover image information from a provided In...
FLTNB ***** m5p_sensitivity
FLTNB GetListPMotionWeightInFrameForLMS(int a_fr, int a_pmsset)
call the eponym function from the oDynamicDataManager object
void LMS_CopyBackwardToSensitivity()
INTNB GetNbSliceOutMask()
Get the number of extrem slices that will be masked at each side.
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.
#define KEYWORD_OPTIONAL_ERROR
void InstantiateOutputImage()
Instanciate Image matrices dedicated to output writing on disk.
void LMS_DeallocateForwardImage()
Free memory for the forward image matrices (for list-mode sensitivity generation) ...
FLTNB GetCardBasisCoefficient(int a_cardBasisFunction, int a_cardGate)
Get the cardiac basis coefficients for the provided cardiac gate and basis function.