8 #include "oImageSpace.hh" 9 #include "vOptimizer.hh" 61 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateImage() -> Initialize to 0."<< endl);
100 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateImage() -> Free memory"<< endl);
130 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateForwardImage() -> Initialize to 0."<< endl);
169 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateForwardImage() -> Free memory"<< endl);
200 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateBackwardImageFromDynamicBasis() -> Initialize to 0."<< endl);
248 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateBackwardImageFromDynamicBasis() -> Free memory" << endl);
288 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateBackwardImageFromDynamicBins() -> Initialize to 0."<< endl);
327 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateBackwardImageFromDynamicBins() -> Free memory"<< endl);
373 if (!a_pathToSensitivityImage.empty())
376 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateSensitivityImage() -> Will be loaded from '" << a_pathToSensitivityImage <<
"'" << endl);
407 if (
m_verbose>=3)
Cout(
"oImageSpace::InstantiateSensitivityImage() -> For all threads"<< endl);
445 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateSensitivityImage() -> Free memory"<< endl);
541 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMiscellaneousImage() -> Free memory"<< endl);
560 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateVisitedVoxelsImage ..."<< endl);
572 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateVisitedVoxelsImage ..."<< 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);
608 Cerr(
"***** oImageSpace::InitMultiModalImage() -> Error reading interfile image '" << a_pathToImage.at(nb) <<
"' !" << endl);
635 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMultiModalImage() -> Free memory" << endl);
651 if (!a_pathToImage.empty())
654 if (
m_verbose>=3)
Cout(
"oImageSpace::InitMaskImage() -> From file '" << a_pathToImage <<
"'"<< endl);
656 ifstream image_file(a_pathToImage.c_str(), ios::in|ios::binary);
657 if (!image_file.is_open())
659 Cerr(
"***** oImageSpace::InitMaskImage() -> Input file '" << a_pathToImage <<
"' is missing or corrupted !" << endl);
670 Cerr(
"***** oImageSpace::InitMaskImage() -> Error reading interfile image '" << a_pathToImage <<
"' !" << endl);
695 if (
m_verbose>=3)
Cout(
"oImageSpace::DeallocateMaskImage() -> Free memory" << endl);
720 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateOutputImage ..."<< endl);
767 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateOutputImage ..."<< endl);
847 if(
m_verbose>=3)
Cout(
"oImageSpace::InstantiateRefImagesForDeformation ..."<< endl);
959 if(
m_verbose>=3)
Cout(
"oImageSpace::DeallocateRefImagesForDeformation ..."<< endl);
1085 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateAttenuationImage ..."<< endl);
1116 if (a_pathToAtnImage.empty())
return 0;
1118 if (
m_verbose>=
VERBOSE_NORMAL)
Cout(
"oImageSpace::InitAttenuationImage() -> Initialize and read attenuation image from file '" << a_pathToAtnImage <<
"'"<< endl);
1137 ifstream image_file(a_pathToAtnImage.c_str(), ios::in|ios::binary);
1139 if (!image_file.is_open())
1141 Cerr(
"***** oImageSpace::InitAttenuationImage() -> Failed to open attenuation image from file '" << a_pathToAtnImage <<
"' !" << endl);
1149 Cerr(
"***** oImageSpace::InitAttenuationImage() -> An error occurred while reading from file '" << a_pathToAtnImage <<
"' !" << endl);
1156 int nb_atn_frames = 1, nb_atn_rgates = 1, nb_atn_cgates = 1;
1162 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);
1214 if (
m_verbose>=
VERBOSE_NORMAL)
Cout(
"oImageSpace::InitAttenuationImage() -> Initialize attenuation image to uniform value " << a_value << endl);
1258 if (!a_pathToInitialImage.empty())
1262 Cerr(
"***** oImageSpace::InitImage()-> Error while trying to read file at " << a_pathToInitialImage << endl);
1271 FLTNB exterior_fov_value = a_value * 1.;
1277 squared_radius_x *= squared_radius_x;
1279 squared_radius_y *= squared_radius_y;
1286 #pragma omp parallel for private(x) schedule(guided) 1291 squared_distance_x *= squared_distance_x;
1297 squared_distance_y *= squared_distance_y;
1299 FLTNB affected_value = 0.;
1301 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. ) affected_value = a_value;
1303 else affected_value = exterior_fov_value;
1314 m4p_image[tbf][rbf][cbf][index] = affected_value;
1338 if(
m_verbose>=3)
Cout(
"oImageSpace::LoadInitialImage ..."<< endl);
1340 ifstream image_file;
1341 image_file.open(a_pathToImage.c_str(), ios::in | ios::binary);
1343 if(!image_file.is_open())
1345 Cerr(
"***** oImageSpace::LoadInitialImage()-> Error reading file!" << endl);
1354 Cerr(
"***** oImageSpace::LoadInitialImage()-> Error reading Interfile : " << a_pathToImage <<
" !" << endl);
1376 if(
m_verbose>=3)
Cout(
"oImageSpace::InitBackwardImage ..." << endl);
1382 #pragma omp parallel for private(th) schedule(static, 1) 1397 #pragma omp parallel for private(th) schedule(static, 1) 1428 if(
m_verbose>=3)
Cout(
"oImageSpace::InitSensitivityImage ..."<< endl);
1435 if (!a_pathToSensitivityImage.empty())
1438 ifstream input_file;
1439 input_file.open(a_pathToSensitivityImage.c_str(), ios::binary | ios::in);
1441 if (input_file.is_open())
1446 Cerr(
"***** oImageSpace::InitSensitivityImage()-> Error reading Interfile : " << a_pathToSensitivityImage <<
" !" << endl);
1454 Cerr(
"***** oImageSpace::InitSensitivityImage() -> Input sensitivity file '" << a_pathToSensitivityImage <<
"' is missing or corrupted !" << endl);
1498 if(
m_verbose>=3)
Cout(
"oDeformationManager::InitBwdImageForDeformation ..." << endl);
1567 if(
m_verbose>=3)
Cout(
"oImageSpace::ComputeOutputImage ..."<< endl);
1580 #pragma omp parallel for private(v) schedule(guided) 1588 if (time_basis_coef==0.)
continue;
1594 if (resp_basis_coef==0.)
continue;
1600 if (card_basis_coef==0.)
continue;
1602 FLTNB global_basis_coeff = time_basis_coef * resp_basis_coef * card_basis_coef;
1604 #pragma omp parallel for private(v) schedule(guided) 1634 Cout(
"oImageSpace::ApplyOutputFlip() -> Flip image" << endl);
1679 INTNB indice_1 = base_z1 + base_y + x;
1680 INTNB indice_2 = base_z2 + base_y + x;
1714 INTNB indice_1 = base_z + base_y1 + x;
1715 INTNB indice_2 = base_z + base_y2 + x;
1748 INTNB indice_1 = base_z + base_y + x_1;
1749 INTNB indice_2 = base_z + base_y + x_2;
1786 Cout(
"oImageSpace::ApplyOutputFOVMasking() -> Mask output image" << endl);
1801 squared_radius_x *= squared_radius_x;
1804 squared_radius_y *= squared_radius_y;
1811 #pragma omp parallel for private(x) schedule(guided) 1816 squared_distance_x *= squared_distance_x;
1822 squared_distance_y *= squared_distance_y;
1824 if ( squared_distance_x/squared_radius_x + squared_distance_y/squared_radius_y <= 1. )
continue;
1878 for (
int z=0; z<removed_slices; z++)
1885 INTNB index = base_z_first + i;
1894 INTNB index = base_z_last + i;
1919 Cout(
"oImageSpace::ApplyOutputMaskImage() -> Mask output image with the provided input mask image" << endl);
1925 #pragma omp parallel for private(v) schedule(guided) 1956 Cout(
"oImageSpace::ApplyMaskToSensitivity() -> Mask the sensitivity image with the provided input mask image" << endl);
1963 #pragma omp parallel for private(v) schedule(guided) 1994 Cout(
"oImageSpace::ApplyMaskToBackwardImage() -> Mask the backward image with the provided input mask image" << endl);
2001 #pragma omp parallel for private(v) schedule(guided) 2032 if (
m_verbose>=3)
Cout(
"oImageSpace::SaveOutputImage ..."<< endl);
2041 if (a_iteration >= 0)
2043 stringstream ss; ss << a_iteration + 1;
2044 path_to_img.append(
"_it").append(ss.str());
2050 stringstream ss; ss << a_subset + 1;
2051 path_to_img.append(
"_ss").append(ss.str());
2058 Cerr(
"***** oImageSpace::SaveOutputImage()-> Error writing Interfile of output image !" << endl);
2073 if (
m_verbose>=3)
Cout(
"oImageSpace::SaveOutputBasisCoefficientImage ..."<< endl);
2082 if (a_iteration >= 0)
2084 stringstream ss; ss << a_iteration + 1;
2085 path_to_img.append(
"_it").append(ss.str());
2091 stringstream ss; ss << a_subset + 1;
2092 path_to_img.append(
"_ss").append(ss.str());
2098 Cerr(
"***** oImageSpace::SaveOutputImage()-> Error writing Interfile of output image !" << endl);
2120 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveDebugImage ..."<< endl);
2123 ofstream output_file;
2124 output_file.open(a_name.c_str(), ios::binary | ios::out);
2133 output_file.close();
2152 if(
m_verbose>=3)
Cout(
"oImageSpace::PrepareForwardImage ..."<< endl);
2175 #if defined(CASTOR_OMP) || defined(CASTOR_MPI) 2176 if (
m_verbose>=3)
Cout(
"oImageSpace::Reduce() -> Merge parallel results" << endl);
2192 int alternative = 2;
2207 else if (alternative==2)
2210 #pragma omp parallel for private(v) schedule(guided) 2233 else if (alternative==2)
2236 #pragma omp parallel for private(v) schedule(guided) 2292 if(
m_verbose>=3)
Cout(
"oImageSpace::CleanNeverVisitedVoxels ..."<< endl);
2295 #pragma omp parallel for private(v) schedule(guided) 2331 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateImage ..."<< endl);
2363 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateImage ..."<< endl);
2394 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateForwardImage ..."<< endl);
2428 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateForwardImage ..."<< endl);
2460 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_InstantiateSensitivityImage ..."<< endl);
2490 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_DeallocateSensitivityImage ..."<< endl);
2524 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyAtnToImage ..."<< endl);
2559 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyAtnToForwardImage ..."<< endl);
2567 int rg_atn = a_use1stMotion ? 0 : rg ;
2568 int cg_atn = a_use1stMotion ? 0 : cg ;
2596 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_CopyBackwardToSensitivity ..."<< endl);
2616 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_PrepareForwardImage ..."<< endl);
2635 #if defined(CASTOR_OMP) || defined(CASTOR_MPI) 2636 if (
m_verbose>=3)
Cout(
"oImageSpace::ReduceBackwardImage() -> Merge parallel results" << endl);
2684 if(
m_verbose>=3)
Cout(
"oImageSpace::LMS_SaveSensitivityImage ..."<< endl);
2698 nb_reco_card_images = 1;
2719 for (
int cg=0 ; cg<nb_reco_card_images ; cg++)
2748 FLTNB sensitivity_value_avg = 0.;
2765 Cerr(
"***** oImageSpace::LMS_SaveSensitivityImage()-> Error writing Sensitivity image !" << endl);
2787 if(
m_verbose>=3)
Cout(
"oImageSpace::SaveSensitivityImage ..."<< endl);
2791 Cerr(
"***** oImageSpace::SaveSensitivityImage()-> Error writing Interfile of output image !" << endl);
2816 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_InstantiateProjectionImage ..."<< endl);
2820 for(
int p=0 ; p<a_nbProjs ; p++)
2823 for(
int px=0 ; px<a_nbPixels ; px++)
2844 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_DeallocateProjectionImage ..."<< endl);
2846 for(
int p=0 ; p<a_nbProjs ; p++)
2870 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_InitImage ..."<< endl);
2872 if (!a_pathToInitialImage.empty())
2876 Cerr(
"***** oImageSpace::PROJ_InitImage()-> Error while trying to read file at " << a_pathToInitialImage << endl);
2883 Cerr(
"***** oImageSpace::PROJ_InitImage()-> No projected image provided ! " << endl);
2905 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_LoadInitialImage ..."<< endl);
2907 ifstream image_file;
2908 image_file.open(a_pathToImage.c_str(), ios::in | ios::binary);
2910 if(!image_file.is_open())
2912 Cerr(
"***** oImageSpace::PROJ_LoadInitialImage()-> Error reading file !" << endl);
2920 Cerr(
"***** oImageSpace::PROJ_LoadInitialImage()-> Error reading Interfile : " << a_pathToImage <<
" !" << endl);
2946 if(
m_verbose>=3)
Cout(
"oImageSpace::PROJ_SaveProjectionImage ..."<< endl);
2948 string img_name =
"_ProjectionImage";
2965 uint16_t nb_projs, nb_heads;
2967 uint16_t nb_bins[2];
2983 Img_fields.
mtx_size[0] = nb_bins[0];
2984 Img_fields.
mtx_size[1] = nb_bins[1];
2985 Img_fields.
vox_size[0] = pix_size[0];
2986 Img_fields.
vox_size[1] = pix_size[1];
3000 string angles_str =
"{";
3001 string radius_str =
"{";
3004 bool has_single_radius =
true;
3006 for(uint16_t p=0 ; p<nb_projs ; p++)
3008 stringstream ss_a, ss_r;
3010 ss_a << p_angles[p];
3011 angles_str.append(ss_a.str());
3012 (p<nb_projs-1) ? angles_str.append(
",") : angles_str.append(
"}");
3015 ss_r << p_radius[p];
3016 radius_str.append(ss_r.str());
3017 (p<nb_projs-1) ? radius_str.append(
",") : radius_str.append(
"}");
3018 if(p_radius[p] != p_radius[0])
3019 has_single_radius =
false;
3026 angles_str.append(
"\n");
3027 radius_str.append(
"\n");
3032 if(has_single_radius)
3036 radius_str = ss.str();
3040 Img_fields.
radius = radius_str;
3046 img_file_name.append(
"_ProjImage");
3050 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)
#define INTF_LERP_DISABLED
void IntfKeySetFieldsOutput(Intf_fields *ap_IF, oImageDimensionsAndQuantification *ap_ID)
Init the keys of the Interfile header of an image to be written on disk.
void LMS_InstantiateImage()
Allocate memory for the main image matrices (for list-mode sensitivity generation) ...
FLTNB * mp_visitedVoxelsImage
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.
string direction_rotation
FLTNB **** m4p_refDynForwardImage
void DeallocateBackwardImageFromDynamicBasis()
Free memory for the backward image matrices.
void LMS_CopyAtnToForwardImage(bool a_use1stMotion, bool a_use2ndMotion)
int GetNbCardBasisFunctions()
Get the number of cardiac basis functions.
#define INTF_LERP_ENABLED
int InitMaskImage(const string &a_pathToImage)
int PROJ_InitImage(const string &a_pathToInitialImage)
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)
FLTNB GetTimeBasisCoefficient(int a_timeBasisFunction, int a_timeFrame)
void LMS_PrepareForwardImage()
Copy current image in forward-image buffer (for list-mode sensitivity generation) ...
FLTNB GetFOVOutPercent()
Get the percentage of transaxial unmasked FOV.
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)
FLTNB ** m2p_projectionImage
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.
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)
FLTNB **** m4p_refDynSensitivityImage
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)
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)
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
void LMS_CopyAtnToImage()
Copy the attenuation image contained in the 'm2p_attenuation' matrix inside the m2p_image matrix...
int InitAttenuationImage(const string &a_pathToAtnImage)
int InitImage(const string &a_pathToInitialImage, FLTNB a_value)
void DeallocateVisitedVoxelsImage()
Free memory for the image matrix containing binary information regarding which 3D voxels have been vi...
void SaveDebugImage(const string &a_name)
void DeallocateMaskImage()
Free memory for the mask image.
FLTNB ***** m5p_refDynBackwardImage
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)
FLTNB ****** m6p_backwardImage
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 GetListPMotionWeightInFrameForLMS(int a_fr, int a_pmsset)
void PROJ_DeallocateProjectionImage(int a_nbProjs)
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)
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.
FLTNB **** m4p_outputImage
const string & GetPathName()
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()
FLTNB GetRespBasisCoefficient(int a_respBasisFunction, int a_respGate)
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)
void LMS_DeallocateImage()
Free memory for the main image matrices (for list-mode sensitivity generation)
FLTNB GetCardBasisCoefficient(int a_cardBasisFunction, int a_cardGate)
void ComputeOutputImage()
int LoadInitialImage(const string &a_pathToImage)
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...
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_multiModalImage
void InstantiateForwardImage()
Allocate memory for the forward image matrices.
FLTNB **** m4p_attenuation
bool GetTimeStaticFlag()
Get the time static flag that says if the reconstruction has only one frame or not.
FLTNB ***** m5p_sensitivity
FLTNB ** m2p_miscellaneousImage
void PROJ_InstantiateProjectionImage(int a_nbProjs, int a_nbPixels)
FLTNB **** m4p_forwardImage
bool GetFlipOutX()
Get the boolean saying if the output image must be flipped along the X axis.
int GetNb1stMotImgsForLMS(int a_fr)
void ReduceBackwardImage(int a_imageIndex, int a_timeIndex, int a_respIndex, int a_cardIndex)
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.
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. ...
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
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.
int GetNbRespGates()
Get the number of respiratory gates.
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)
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.
oImageDimensionsAndQuantification * mp_ID
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)
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 GetNbRespBasisFunctions()
Get the number of respiratory basis functions.
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...
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) ...