8 #include "vDeformation.hh" 9 #include "oImageDimensionsAndQuantification.hh" 10 #include "oImageSpace.hh" 62 Cerr(
"***** vDeformation::CheckParameters() -> No image dimensions provided !" << endl);
69 Cerr(
"***** vDeformation::CheckParameters() -> Wrong verbosity level provided !" << endl);
76 Cerr(
"***** vDeformation::CheckParameters() -> Number of transformations in the deformation has not been initialized !" << endl);
83 Cerr(
"***** vDeformation::CheckParameters() -> An error occurred while checking parameters of the child dynamic class !" << endl);
119 Cerr(
"***** vDeformation::ApplyDeformationsToBackwardImage() -> Called while not initialized !" << endl);
134 Cerr(
"***** vDeformation::ApplyDeformationsToBackwardImage()-> An error occurred while performing backward deformation of the backward image !" << endl);
135 Cerr(
"***** frame index " << a_fr <<
" respiratory image index " << rimg<<
" cardiac image index " << cimg<<
" !" << endl);
171 Cerr(
"***** vDeformation::ApplyDeformationsToHistoSensitivityImage() -> Called while not initialized !" << endl);
185 Cerr(
"***** vDeformation::ApplyDeformationsToHistoSensitivityImage()-> An error occurred while performing backward deformation of the backward image !" << endl);
186 Cerr(
"***** frame index " << a_fr <<
" respiratory image index " << rimg<<
" cardiac image index " << cimg<<
" !" << endl);
226 Cerr(
"***** vDeformation::PerformDeformation() -> Called while not initialized !" << endl);
248 Cerr(
"***** vDeformation::ApplyDeformations()-> An error occurred while performing backward deformation of the backward image !" << endl);
249 Cerr(
"***** frame index " << a_fr <<
" respiratory image index " << a_rimg<<
" cardiac image index " << a_cimg<<
" !" << endl);
271 Cerr(
"***** vDeformation::ApplyDeformations()-> An error occurred while performing forward deformation of the forward image !" << endl);
272 Cerr(
"***** frame index " << a_fr <<
" respiratory image index " << a_rimg<<
" cardiac image index " << a_cimg<<
" !" << endl);
306 Cerr(
"***** vDeformation::PerformHistoSensitivityDeformation() -> Called while not initialized !" << endl);
326 Cerr(
"***** vDeformation::PerformHistoSensitivityDeformation()-> An error occurred while performing backward deformation of the sensitivity image !" << endl);
327 Cerr(
"***** frame index " << fr <<
" respiratory image index " << rimg<<
" cardiac image index " << cimg<<
" !" << endl);
371 Cerr(
"***** vDeformation::PerformSensitivityDeformation() -> Called while not initialized !" << endl);
383 Cerr(
"***** vDeformation::PerformSensitivityDeformation -> An error occurred while performing forward deformation !" << endl);
384 Cerr(
"***** frame index " << fr <<
" respiratory gate index " << rg<<
" cardiac gate index " << cg<<
" !" << endl);
395 Cerr(
"***** vDeformation::PerformSensitivityDeformation -> An error occurred while performing backward deformation !" << endl);
396 Cerr(
"***** frame index " << fr <<
" respiratory gate index " << rg<<
" cardiac gate index " << cg<<
" !" << endl);
402 Cerr(
"***** vDeformation::PerformDeformation -> Unknown type of deformation !" << endl);
429 int incX = dX>0 ? 1 : -1;
433 dX = (dX>=0) ? dX : -dX;
434 dY = (dY>=0) ? dY : -dY;
435 dZ = (dZ>=0) ? dZ : -dZ;
439 if ((iiv < nb_tot_vox)
441 ap_outputImage[iov] += ap_inputImage[iiv] * (1.-dX)*(1.-dY)*(1.-dZ);
443 if ((iiv+incX < nb_tot_vox)
444 && (((int)iiv)+incX >= 0))
445 ap_outputImage[iov] += ap_inputImage[iiv+incX] * dX*(1.-dY)*(1.-dZ);
447 if ((iiv+incY < nb_tot_vox )
448 && (((
int)iiv)+incY >= 0))
449 ap_outputImage[iov] += ap_inputImage[iiv +incY] * (1.-dX)*dY*(1.-dZ);
451 if ((iiv+incX+incY < nb_tot_vox)
452 && ( ((
int)iiv)+incX+incY >= 0))
453 ap_outputImage[iov] += ap_inputImage[iiv+incX+incY] * dX*dY*(1.-dZ);
455 if ((iiv+incZ < nb_tot_vox)
456 && (((int)iiv)+incZ) >= 0)
457 ap_outputImage[iov] += ap_inputImage[iiv+incZ] * (1.-dX)*(1.-dY)*dZ;
459 if ((iiv+incX+incZ) < nb_tot_vox
460 && (((int)iiv)+incX+incZ) >=0 )
461 ap_outputImage[iov] += ap_inputImage[iiv+incX+incZ] * dX*(1.-dY)*dZ;
463 if ((iiv+incY+incZ < nb_tot_vox)
464 && (((int)iiv)+incY+incZ >= 0))
465 ap_outputImage[iov] += ap_inputImage[iiv+incY+incZ] * (1.-dX)*dY*dZ;
467 if ((iiv+incX+incY+incZ < nb_tot_vox)
468 && (((int)iiv)+incX+incY+incZ >= 0))
469 ap_outputImage[iov] += ap_inputImage[iiv+incX+incY+incZ] *dX*dY*dZ;
FLTNB **** m4p_refDynForwardImage
FLTNB **** m4p_refDynSensitivityImage
FLTNB ***** m5p_refDynBackwardImage
FLTNB ****** m6p_backwardImage
int GetNbBackwardImages()
INTNB GetNbVoxXY()
Get the number of voxels in a slice.
FLTNB ***** m5p_sensitivity
#define VERBOSE_DEBUG_NORMAL
FLTNB **** m4p_forwardImage
int GetNbCardGates()
Get the number of cardiac gates.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
INTNB GetNbVoxXYZ()
Get the total number of voxels.
int GetNbThreadsForProjection()
Get the number of threads used for projections.
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
int GetNbRespGates()
Get the number of respiratory gates.