8 #include "oDeformationManager.hh" 9 #include "sAddonManager.hh" 47 mp_deformationRequirement = NULL;
66 if (mp_deformationRequirement)
delete[] mp_deformationRequirement;
115 Cerr(
"***** oDeformationManager::CheckParameters() -> No image dimensions provided !" << endl);
121 Cerr(
"***** oDeformationManager::CheckParameters() -> Wrong number of respiratory gates !" << endl);
127 Cerr(
"***** oDeformationManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
133 Cerr(
"***** oDeformationManager::CheckParameters() -> Wrong data mode provided ! (should be =0 (list-mode) or =1 (histogram)" << endl);
157 Cerr(
"***** oDeformationManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
183 Cerr(
"***** oDeformationManager::Initialize() -> A problem occurred while parsing deformation options and initializing them !" << endl);
212 string deformation =
"";
213 string list_options =
"";
214 string file_options =
"";
237 if (colon!=string::npos)
242 file_options =
m_options.substr(colon+1);
247 else if (comma!=string::npos)
252 list_options =
m_options.substr(comma+1);
271 Cerr(
"***** oDeformationManager::ParseOptionsAndInitializeDeformations() -> Deformation '" << deformation <<
"' does not exist !" << endl);
283 Cerr(
"***** oDeformationManager::ParseOptionsAndInitializeDeformations() -> A problem occurred while reading and checking respiratory deformation's configuration file !" << endl);
289 Cerr(
"***** oDeformationManager::ParseOptionsAndInitializeDeformations() -> A problem occurred while parsing and reading respiratory deformation's options !" << endl);
296 Cerr(
"***** oDeformationManager::ParseOptionsAndInitializeDeformations() -> A problem occurred while checking respiratory deformation parameters !" << endl);
302 Cerr(
"***** oDeformationManager::ParseOptionsAndInitializeDeformations() -> A problem occurred while initializing respiratory deformation !" << endl);
388 if(
m_verbose >=
VERBOSE_DETAIL)
Cout(
"oDeformationManager::InitImageForDeformation()-> Apply forward image deformation of the forward image(s) for each dynamic image (is any) " << endl);
402 Cerr(
"***** oDeformationManager::InitImageForDeformation()-> An error occurred while performing image deformation during the reconstruction !" << endl);
437 Cerr(
"***** oDeformationManager::ApplyDeformationForSensitivityGeneration() -> Called while not initialized !" << endl);
456 Cout(
"oDeformationManager::ApplyDeformationForSensitivityGeneration(): ");
459 Cout(
"->BACKWARD Deformation of the sensitivity image with transformation parameter "<<idx<<
", (respiratory gate "<<rg <<
" and card gate " <<cg<<
")." <<endl);
461 Cout(
"->FORWARD Deformation of the sensitivity image with transformation parameter "<<idx<<
", (respiratory gate "<<rg <<
" and card gate " <<cg<<
")." <<endl);
466 Cerr(
"***** oDeformationManager::ApplyDeformationForSensitivityGeneration()-> An error occurred while performing deformation for respiratory motion correction for the sensitivity image generation !" << endl);
493 Cerr(
"***** oDeformationManager::PerformDeformation() -> Called while not initialized !" << endl);
525 if (time_basis_coef==0.)
continue;
531 <<
", for resp image " <<rimg
532 <<
" and card image " <<cimg<<
"." 533 <<
" Frame # " << tbf << endl);
536 Cerr(
"***** oDeformationManager::PerformDeformation()-> An error occurred while performing image deformation during the reconstruction !" << endl);
544 Cerr(
"***** oDeformationManager::PerformDeformation()-> An error occurred while performing sensitivity image deformation (histogram mode) during the reconstruction !" << endl);
576 Cerr(
"***** oDeformationManager::ApplyDeformationsToBackwardImage() -> Called while not initialized !" << endl);
598 if(
m_verbose >=
VERBOSE_DETAIL)
Cout(
"oDeformationManager::ApplyDeformationsToBackwardImage-> Transformation parameter #" << idx<<
"." <<endl);
602 Cerr(
"***** oDeformationManager::ApplyDeformationsToBackwardImage()-> An error occurred while performing final backward image deformation !" << endl);
610 Cerr(
"***** oDeformationManager::ApplyDeformationsToBackwardImage()-> An error occurred while performing final backward image deformation of the sensitivity image !" << endl);
643 Cerr(
"***** oDeformationManager::TestDeformationOnImage()-> An error occurred while testing deformation !" << endl);
661 bool oDeformationManager::AllThreadsRequireDeformation()
664 if (!mp_deformationRequirement[th])
678 void oDeformationManager::UnsetDeformationRequirements()
681 mp_deformationRequirement[th] =
false;
FLTNB **** m4p_refDynForwardImage
int GetPMotionFirstIndexForFrame(int a_fr)
int GetNbCardBasisFunctions()
Get the number of cardiac basis functions.
int GetCurrentPMotionIndex(int a_th)
void ShowHelpDeformation()
Show help about all implemented deformations.
FLTNB GetTimeBasisCoefficient(int a_timeBasisFunction, int a_timeFrame)
int GetCurrentCardImage(int a_th)
int GetNbTimeBasisFunctions()
Get the number of time basis functions.
int GetPMotionLastIndexForFrame(int a_fr)
std::map< string, maker_deformation > mp_listOfDeformations
static sAddonManager * GetInstance()
int GetCurrentRespImage(int a_th)
void InitRefImagesForDeformation()
void DeallocateRefImagesForDeformation()
Free memory for the buffer sensitivity image required for image-based deformation. This function is called from the Deformation Manager.
int GetCurrentCardGate(int a_th)
#define VERBOSE_DEBUG_NORMAL
FLTNB **** m4p_forwardImage
This class holds all the matrices in the image domain that can be used in the algorithm: image...
int GetNbThreadsForProjection()
Get the number of threads used for projections.
int GetCurrentRespGate(int a_th)
int GetCurrentTimeFrame(int a_th)
void InstantiateRefImagesForDeformation()
Allocate memory for the buffer sensitivity image required for image-based deformation. This function is called from the Deformation Manager.
int GetNbRespBasisFunctions()
Get the number of respiratory basis functions.