85 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateImage() -> Initialize to 0."<< endl);
124 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateImage() -> Free memory"<< endl);
154 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateForwardImage() -> Initialize to 0."<< endl);
193 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateForwardImage() -> Free memory"<< endl);
224 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateBackwardImageFromDynamicBasis() -> Initialize to 0."<< endl);
272 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateBackwardImageFromDynamicBasis() -> Free memory" << endl);
312 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateBackwardImageFromDynamicBins() -> Initialize to 0."<< endl);
351 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateBackwardImageFromDynamicBins() -> Free memory"<< endl);
397 if (!a_pathToSensitivityImage.empty())
400 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateSensitivityImage() -> Will be loaded from '" << a_pathToSensitivityImage <<
"'" << endl);
431 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateSensitivityImage() -> For all threads"<< endl);
469 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateSensitivityImage() -> Free memory"<< endl);
565 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMiscellaneousImage() -> Free memory"<< endl);
585 if (!a_pathToImage.empty())
594 if (
m_verbose>=3)
Cout(
"oImageSpace::InitMultiModalImage() -> From file '" << a_pathToImage.at(nb) <<
"'"<< endl);
596 ifstream image_file(a_pathToImage.at(nb).c_str(), ios::in|ios::binary);
597 if (!image_file.is_open())
599 Cerr(
"***** oImageSpace::InitMultiModalImage() -> Input file '" << a_pathToImage.at(nb) <<
"' is missing or corrupted !" << endl);
620 Cerr(
"***** oImageSpace::InitMultiModalImage() -> Error reading interfile image '" << a_pathToImage.at(nb) <<
"' !" << endl);
647 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMultiModalImage() -> Free memory" << endl);
678 if (!a_pathToImage.empty())
681 if (
m_verbose>=3)
Cout(
"oImageSpace::InitMaskImage() -> From file '" << a_pathToImage <<
"'"<< endl);
683 ifstream image_file(a_pathToImage.c_str(), ios::in|ios::binary);
684 if (!image_file.is_open())
686 Cerr(
"***** oImageSpace::InitMaskImage() -> Input file '" << a_pathToImage <<
"' is missing or corrupted !" << endl);
697 Cerr(
"***** oImageSpace::InitMaskImage() -> Error reading interfile image '" << a_pathToImage <<
"' !" << endl);
722 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMaskImage() -> Free memory" << endl);
747 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateOutputImage ..."<< endl);
794 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateOutputImage ..."<< endl);
874 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateRefImagesForDeformation ..."<< endl);
986 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateRefImagesForDeformation ..."<< endl);
1005 if(
m_verbose>=3)
Cout(
"oImageSpace::Deallocatem5p_refDynBackwardImage ..."<< endl);
1016 if(
m_verbose>=3)
Cout(
"oImageSpace::Deallocate m5p_refDynBackwardImage[img][tbf][rbf][cbf] ..."<< endl);
1019 if(
m_verbose>=3)
Cout(
"oImageSpace::Deallocate m5p_refDynBackwardImage[img][tbf][rbf]..."<< endl);
1022 if(
m_verbose>=3)
Cout(
"oImageSpace::Deallocate m5p_refDynBackwardImage[img][tbf] ..."<< endl);
1025 if(
m_verbose>=3)
Cout(
"oImageSpace::Deallocate m5p_refDynBackwardImage[img]..."<< endl);
1028 if(
m_verbose>=3)
Cout(
"oImageSpace::Deallocate m5p_refDynBackwardImage..."<< endl);
1032 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateRm4p_refDynSensitivityImage ..."<< endl);
1051 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateRm4p_refDynSensitivityImageOK ..."<< endl);
1123 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateVisitedVoxelsImage ..."<< endl);
1167 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateVisitedVoxelsImage ..."<< endl);
1202 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateAttenuationImage ..."<< endl);
1236 if (a_pathToAtnImage.empty())
return 0;
1238 if (
m_verbose>=
VERBOSE_NORMAL)
Cout(
"oImageSpace::InitAttenuationImage() -> Initialize and read attenuation image from file '" << a_pathToAtnImage <<
"'"<< endl);
1260 ifstream image_file(a_pathToAtnImage.c_str(), ios::in|ios::binary);
1262 if (!image_file.is_open())
1264 Cerr(
"***** oImageSpace::InitAttenuationImage() -> Failed to open attenuation image from file '" << a_pathToAtnImage <<
"' !" << endl);
1272 Cerr(
"***** oImageSpace::InitAttenuationImage() -> An error occured while reading from file '" << a_pathToAtnImage <<
"' !" << endl);
1298 if (!a_pathToInitialImage.empty())
1302 Cerr(
"***** oImageSpace::InitImage()-> Error while trying to read file at " << a_pathToInitialImage << endl);
1311 FLTNB exterior_fov_value = a_value * 1.;
1317 squared_radius_x *= squared_radius_x;
1319 squared_radius_y *= squared_radius_y;
1326 #pragma omp parallel for private(x) schedule(guided)
1331 squared_distance_x *= squared_distance_x;
1337 squared_distance_y *= squared_distance_y;
1339 FLTNB affected_value = 0.;
1341 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. ) affected_value = a_value;
1343 else affected_value = exterior_fov_value;
1354 m4p_image[tbf][rbf][cbf][index] = affected_value;
1378 if(
m_verbose>=3)
Cout(
"oImageSpace::LoadInitialImage ..."<< endl);
1380 ifstream image_file;
1381 image_file.open(a_pathToImage.c_str(), ios::in | ios::binary);
1383 if(!image_file.is_open())
1385 Cerr(
"***** oImageSpace::LoadInitialImage()-> Error reading file!" << endl);
1394 Cerr(
"***** oImageSpace::LoadInitialImage()-> Error reading Interfile : " << a_pathToImage <<
" !" << endl);
1416 if(
m_verbose>=3)
Cout(
"oImageSpace::InitBackwardImage ..." << endl);
1422 #pragma omp parallel for private(th) schedule(static, 1)
1437 #pragma omp parallel for private(th) schedule(static, 1)
1468 if(
m_verbose>=3)
Cout(
"oImageSpace::InitSensitivityImage ..."<< endl);
1475 if (!a_pathToSensitivityImage.empty())
1478 ifstream input_file;
1479 input_file.open(a_pathToSensitivityImage.c_str(), ios::binary | ios::in);
1481 if (input_file.is_open())
1486 Cerr(
"***** oImageSpace::InitSensitivityImage()-> Error reading Interfile : " << a_pathToSensitivityImage <<
" !" << endl);
1494 Cerr(
"***** oImageSpace::InitSensitivityImage() -> Input sensitivity file '" << a_pathToSensitivityImage <<
"' is missing or corrupted !" << endl);
1538 if(
m_verbose>=3)
Cout(
"oDeformationManager::InitBwdImageForDeformation ..." << endl);
1607 if(
m_verbose>=3)
Cout(
"oImageSpace::ComputeOutputImage ..."<< endl);
1620 #pragma omp parallel for private(v) schedule(guided)
1628 if (time_basis_coef==0.)
continue;
1634 if (resp_basis_coef==0.)
continue;
1640 if (card_basis_coef==0.)
continue;
1642 FLTNB global_basis_coeff = time_basis_coef * resp_basis_coef * card_basis_coef;
1644 #pragma omp parallel for private(v) schedule(guided)
1673 Cout(
"oImageSpace::ApplyOutputFlip() -> Flip image" << endl);
1707 INTNB indice_1 = base_z1 + base_y + x;
1708 INTNB indice_2 = base_z2 + base_y + x;
1737 INTNB indice_1 = base_z + base_y1 + x;
1738 INTNB indice_2 = base_z + base_y2 + x;
1766 INTNB indice_1 = base_z + base_y + x_1;
1767 INTNB indice_2 = base_z + base_y + x_2;
1797 Cout(
"oImageSpace::ApplyOutputFOVMasking() -> Mask output image" << endl);
1812 squared_radius_x *= squared_radius_x;
1815 squared_radius_y *= squared_radius_y;
1822 #pragma omp parallel for private(x) schedule(guided)
1827 squared_distance_x *= squared_distance_x;
1833 squared_distance_y *= squared_distance_y;
1835 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. )
continue;
1869 for (
int z=0; z<removed_slices; z++)
1876 INTNB index = base_z_first + i;
1884 INTNB index = base_z_last + i;
1908 Cout(
"oImageSpace::ApplyOutputMaskImage() -> Mask output image with the provided input mask image" << endl);
1914 #pragma omp parallel for private(v) schedule(guided)
1945 Cout(
"oImageSpace::ApplyMaskToSensitivity() -> Mask the sensitivity image with the provided input mask image" << endl);
1952 #pragma omp parallel for private(v) schedule(guided)
1983 Cout(
"oImageSpace::ApplyMaskToBackwardImage() -> Mask the backward image with the provided input mask image" << endl);
1990 #pragma omp parallel for private(v) schedule(guided)
2021 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveOutputImage ..."<< endl);
2034 if (a_iteration >= 0)
2036 stringstream ss; ss << a_iteration + 1;
2037 path_to_img.append(
"_it").append(ss.str());
2043 stringstream ss; ss << a_subset + 1;
2044 path_to_img.append(
"_ss").append(ss.str());
2051 Cerr(
"***** oImageSpace::SaveOutputImage()-> Error writing Interfile of output image !" << endl);
2076 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveDebugImage ..."<< endl);
2079 ofstream output_file;
2080 output_file.open(a_name.c_str(), ios::binary | ios::out);
2089 output_file.close();
2108 if(
m_verbose>=3)
Cout(
"oImageSpace::PrepareForwardImage ..."<< endl);
2133 #if defined(CASTOR_OMP) || defined(CASTOR_MPI)
2134 if (
m_verbose>=3)
Cout(
"oImageSpace::Reduce() -> Merge parallel results" << endl);
2150 int alternative = 2;
2165 else if (alternative==2)
2168 #pragma omp parallel for private(v) schedule(guided)
2191 else if (alternative==2)
2194 #pragma omp parallel for private(v) schedule(guided)
2250 if(
m_verbose>=3)
Cout(
"oImageSpace::CleanNeverVisitedVoxels ..."<< endl);
2279 #pragma omp parallel for private(v) schedule(guided)
2310 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateImage ..."<< endl);
2342 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateImage ..."<< endl);
2373 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateForwardImage ..."<< endl);
2407 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateForwardImage ..."<< endl);
2439 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateSensitivityImage ..."<< endl);
2469 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateSensitivityImage ..."<< endl);
2503 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyAtnToImage ..."<< endl);
2538 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyAtnToForwardImage ..."<< endl);
2546 int rg_atn = a_use1stMotion ? 0 : rg ;
2547 int cg_atn = a_use1stMotion ? 0 : cg ;
2575 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyBackwardToSensitivity ..."<< endl);
2595 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_PrepareForwardImage ..."<< endl);
2614 #if defined(CASTOR_OMP) || defined(CASTOR_MPI)
2615 if (
m_verbose>=3)
Cout(
"oImageSpace::ReduceBackwardImage() -> Merge parallel results" << endl);
2663 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_SaveSensitivityImage ..."<< endl);
2674 nb_reco_card_images = 1;
2693 for (
int cg=0 ; cg<nb_reco_card_images ; cg++)
2708 Cerr(
"***** oImageSpace::LMS_SaveSensitivityImage()-> Error writing Sensitivity image !" << endl);
2730 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveSensitivityImage ..."<< endl);
2734 Cerr(
"***** oImageSpace::SaveSensitivityImage()-> Error writing Interfile of output image !" << endl);
2759 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_InstantiateProjectionImage ..."<< endl);
2763 for(
int p=0 ; p<a_nbProjs ; p++)
2766 for(
int px=0 ; px<a_nbPixels ; px++)
2787 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_DeallocateProjectionImage ..."<< endl);
2789 for(
int p=0 ; p<a_nbProjs ; p++)
2813 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_InitImage ..."<< endl);
2815 if (!a_pathToInitialImage.empty())
2819 Cerr(
"***** oImageSpace::PROJ_InitImage()-> Error while trying to read file at " << a_pathToInitialImage << endl);
2826 Cerr(
"***** oImageSpace::PROJ_InitImage()-> No projected image provided ! " << endl);
2848 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_LoadInitialImage ..."<< endl);
2850 ifstream image_file;
2851 image_file.open(a_pathToImage.c_str(), ios::in | ios::binary);
2853 if(!image_file.is_open())
2855 Cerr(
"***** oImageSpace::PROJ_LoadInitialImage()-> Error reading file !" << endl);
2863 Cerr(
"***** oImageSpace::PROJ_LoadInitialImage()-> Error reading Interfile : " << a_pathToImage <<
" !" << endl);
2889 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_SaveProjectionImage ..."<< endl);
2891 string img_name =
"_ProjectionImage";
2908 uint16_t nb_projs, nb_heads;
2910 uint16_t nb_bins[2];
2926 Img_fields.
mtx_size[0] = nb_bins[0];
2927 Img_fields.
mtx_size[1] = nb_bins[1];
2928 Img_fields.
vox_size[0] = pix_size[0];
2929 Img_fields.
vox_size[1] = pix_size[1];
2943 string angles_str =
"{";
2944 string radius_str =
"{";
2947 bool has_single_radius =
true;
2949 for(uint16_t p=0 ; p<nb_projs ; p++)
2951 stringstream ss_a, ss_r;
2953 ss_a << p_angles[p];
2954 angles_str.append(ss_a.str());
2955 (p<nb_projs-1) ? angles_str.append(
",") : angles_str.append(
"}");
2958 ss_r << p_radius[p];
2959 radius_str.append(ss_r.str());
2960 (p<nb_projs-1) ? radius_str.append(
",") : radius_str.append(
"}");
2961 if(p_radius[p] != p_radius[0])
2962 has_single_radius =
false;
2969 angles_str.append(
"\n");
2970 radius_str.append(
"\n");
2975 if(has_single_radius)
2979 radius_str = ss.str();
2983 Img_fields.
radius = radius_str;
2989 img_file_name.append(
"_ProjImage");
2993 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.
int GetPMotionFirstIndexForLMS(int a_fr)
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 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.
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.
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) ...
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.
FLTNB ***** m5p_multiModalImage
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.
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
void LMS_CopyBackwardToSensitivity()
INTNB GetNbSliceOutMask()
Get the number of extrem slices that will be masked at each side.
FLTNB **** m4p_visitedVoxelsImage
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.
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.