![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
This class is designed to manage the image-based deformation part of the reconstruction. More...
#include <oDeformationManager.hh>
Public Member Functions | |
oDeformationManager () | |
Constructor of oDeformationManager. Simply set all data members to default values. | |
~oDeformationManager () | |
Destructor of oDeformationManager. Free memory from all allocated tabs. | |
int | CheckParameters () |
This function is used to check parameters after the latter have been all set using Set functions. | |
int | Initialize () |
Set the flags for the different motion types and instanciate/initialize deformation objects through the ParseOptionsAndInitializeDeformations() private function. | |
void | InstantiateImageForDeformation (oImageSpace *ap_Image) |
If deformation is enabled, ask the Image Space to Instantiate the temporary backward image for deformation If reconstruction is in histogram mode, the temporal sensitivity image is instanciated as well. | |
void | DeallocateImageForDeformation (oImageSpace *ap_Image) |
If deformation is enabled, ask the Image Space to free memory of the temporary backward image for deformation If reconstruction is in histogram mode, the temporal sensitivity image is deallocated as well. | |
void | InitImageForDeformation (oImageSpace *ap_Image) |
If deformation is enabled, ask the Image Space to initialize the temporary backward image for deformation If reconstruction is in histogram mode, the temporal sensitivity image is initialized as well. | |
void | SetVerbose (int a_verboseLevel) |
Set the verbose level. | |
void | SetDataMode (int a_dataMode) |
Set the mode of reconstruction. | |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification) |
Set the image dimensions in use. | |
void | SetOptionsResp (const string &a_optionsResp, int a_nbGates) |
Set the respiratory motion options contained in the provided string, and the related number of gates. | |
void | SetOptionsCard (const string &a_optionsCard, int a_nbGates) |
Set the cardiac motion options contained in the provided string, and the related number of gates. | |
void | SetOptionsInv (const string &a_optionsInv) |
Set the involuntary patient motion options contained in the provided string. | |
bool | UseDeformationResp () |
Indicate if the respiratory motion deformation is enabled. | |
bool | UseDeformationCard () |
Indicate if the cardiac motion deformation is enabled. | |
bool | UseDeformationInv () |
Indicate if the involuntary patient motion deformation is enabled. | |
int | GetNbSensImagesRespDeformation (int a_value) |
return the required number of respiratory images in the sensitivity image depending on the respiratory deformation model | |
int | GetNbSensImagesCardDeformation (int a_value) |
return the required number of cardiac images in the sensitivity image depending on the cardiac deformation model | |
int | ApplyDeformationForSensitivityGeneration (oImageSpace *ap_Image, int a_defDirection, int a_defType, int fr, int rg, int cg) |
Apply deformations during the list-mode sensitivity image generation. | |
int | ApplyDeformationsToForwardImage (oImageSpace *ap_Image) |
Apply initial deformations on the forwardImage before loop on events. | |
int | ApplyDeformationsToBackwardImage (oImageSpace *ap_Image) |
Apply final backward deformations on the backward image. | |
int | PerformDeformation (oImageSpace *ap_Image) |
Apply deformations during reconstruction. | |
Private Member Functions | |
int | ParseOptionsAndInitializeDeformations () |
Parse respiratory/cardiac/involuntary patient motion options contained in the previously provided strings. This function is called inside the Initialize() function. | |
Private Attributes | |
oImageDimensionsAndQuantification * | mp_ID |
string | m_optionsResp |
string | m_optionsCard |
string | m_optionsInv |
vDeformation * | mp_DeformationResp |
vDeformation * | mp_DeformationCard |
vDeformation * | mp_DeformationInv |
bool | m_UseDeformationResp |
bool | m_UseDeformationCard |
bool | m_UseDeformationInv |
int | m_currentRespGate |
int | m_currentCardGate |
int | m_currentPMotionIndex |
int | m_nbRespGates |
int | m_nbCardGates |
int | m_verbose |
int | m_dataMode |
bool | m_checked |
bool | m_initialized |
This class is designed to manage the image-based deformation part of the reconstruction.
As each manager class, it is created in the main program, all parameters are then set, checked, and the manager is initialized.
The manager is then used by the algorithm itself, where the function PerformDeformation() is called each time the data belongs to a new "gate".
The deformation functions are not multithreaded, therefore the threads are synchronized (inside the main loop of the main algorithm) before performing any image transformation.
Definition at line 47 of file oDeformationManager.hh.
Constructor of oDeformationManager. Simply set all data members to default values.
Definition at line 31 of file oDeformationManager.cc.
Destructor of oDeformationManager. Free memory from all allocated tabs.
Definition at line 71 of file oDeformationManager.cc.
int oDeformationManager::ApplyDeformationForSensitivityGeneration | ( | oImageSpace * | ap_Image, |
int | a_defDirection, | ||
int | a_defType, | ||
int | fr, | ||
int | rg, | ||
int | cg | ||
) |
Apply deformations during the list-mode sensitivity image generation.
oImageSpace* | ap_Image : required to access oImageSpace image matrices |
int | a_defDirection : direction of the deformation (forward/backward) |
int | a_defType : Nature of the motion (Respiratory/Cardiac/Involuntary Patient) |
int | fr |
int | rg |
int | cg |
Perform deformation of type 'a_defType' on the forward_image or the backward_image matrices corresponding to the current fr, rg, cg (if any), and depending on the defDirection.
Definition at line 561 of file oDeformationManager.cc.
int oDeformationManager::ApplyDeformationsToBackwardImage | ( | oImageSpace * | ap_Image | ) |
Apply final backward deformations on the backward image.
oImageSpace* | ap_Image : required to access oImageSpace image matrices |
Call the eponym function for the deformation object, as well as >ApplyDeformationsToHistoSensitivityImage() if data mode is histogram.
Then reinitialize the temporary backup deformation images (the backward image, and the sensitivity image if data mode is histogram)
Definition at line 802 of file oDeformationManager.cc.
int oDeformationManager::ApplyDeformationsToForwardImage | ( | oImageSpace * | ap_Image | ) |
Apply initial deformations on the forwardImage before loop on events.
oImageSpace* | ap_Image : required to access oImageSpace image matrices |
Definition at line 633 of file oDeformationManager.cc.
This function is used to check parameters after the latter have been all set using Set functions.
Definition at line 158 of file oDeformationManager.cc.
void oDeformationManager::DeallocateImageForDeformation | ( | oImageSpace * | ap_Image | ) |
If deformation is enabled, ask the Image Space to free memory of the temporary backward image for deformation
If reconstruction is in histogram mode, the temporal sensitivity image is deallocated as well.
oImageSpace* | ap_Image : required to call oImageSpace deallocation functions |
Definition at line 115 of file oDeformationManager.cc.
oDeformationManager::GetNbSensImagesCardDeformation | ( | int | a_value | ) | [inline] |
return the required number of cardiac images in the sensitivity image depending on the cardiac deformation model
a_value | : default number of cardiac images |
Definition at line 187 of file oDeformationManager.hh.
oDeformationManager::GetNbSensImagesRespDeformation | ( | int | a_value | ) | [inline] |
return the required number of respiratory images in the sensitivity image depending on the respiratory deformation model
a_value | : default number of cardiac images |
Definition at line 179 of file oDeformationManager.hh.
int oDeformationManager::Initialize | ( | ) |
Set the flags for the different motion types and instanciate/initialize deformation objects through the ParseOptionsAndInitializeDeformations() private function.
Definition at line 207 of file oDeformationManager.cc.
void oDeformationManager::InitImageForDeformation | ( | oImageSpace * | ap_Image | ) |
If deformation is enabled, ask the Image Space to initialize the temporary backward image for deformation
If reconstruction is in histogram mode, the temporal sensitivity image is initialized as well.
oImageSpace* | ap_Image : required to call oImageSpace initialization functions |
Definition at line 138 of file oDeformationManager.cc.
void oDeformationManager::InstantiateImageForDeformation | ( | oImageSpace * | ap_Image | ) |
If deformation is enabled, ask the Image Space to Instantiate the temporary backward image for deformation
If reconstruction is in histogram mode, the temporal sensitivity image is instanciated as well.
oImageSpace* | ap_Image : required to call oImageSpace instanciation functions |
Definition at line 92 of file oDeformationManager.cc.
int oDeformationManager::ParseOptionsAndInitializeDeformations | ( | ) | [private] |
Parse respiratory/cardiac/involuntary patient motion options contained in the previously provided strings. This function is called inside the Initialize() function.
Manage the options reading and initialize specific vDeformation
Options are a string containing first the name of the deformation, then either a ':' and a configuration file specific to the deformation
Definition at line 269 of file oDeformationManager.cc.
int oDeformationManager::PerformDeformation | ( | oImageSpace * | ap_Image | ) |
Apply deformations during reconstruction.
oImageSpace* | ap_Image : required to access oImageSpace image matrices |
Call the eponym function for the deformation object, as well as PerformHistoSensitivityDeformation() if data mode is histogram.
Definition at line 703 of file oDeformationManager.cc.
oDeformationManager::SetDataMode | ( | int | a_dataMode | ) | [inline] |
Set the mode of reconstruction.
a_dataMode | : (histogram/list-mode) |
required to enable/disable sensitivity image deformation in histogram mode
Definition at line 120 of file oDeformationManager.hh.
oDeformationManager::SetImageDimensionsAndQuantification | ( | oImageDimensionsAndQuantification * | ap_ImageDimensionsAndQuantification | ) | [inline] |
Set the image dimensions in use.
ap_ImageDimensionsAndQuantification |
Definition at line 127 of file oDeformationManager.hh.
oDeformationManager::SetOptionsCard | ( | const string & | a_optionsCard, |
int | a_nbGates | ||
) | [inline] |
Set the cardiac motion options contained in the provided string, and the related number of gates.
a_optionsCard | |
a_nbGates |
Definition at line 143 of file oDeformationManager.hh.
oDeformationManager::SetOptionsInv | ( | const string & | a_optionsInv | ) | [inline] |
Set the involuntary patient motion options contained in the provided string.
a_optionsInv |
Definition at line 150 of file oDeformationManager.hh.
oDeformationManager::SetOptionsResp | ( | const string & | a_optionsResp, |
int | a_nbGates | ||
) | [inline] |
Set the respiratory motion options contained in the provided string, and the related number of gates.
a_optionsResp | |
a_nbGates |
Definition at line 135 of file oDeformationManager.hh.
oDeformationManager::SetVerbose | ( | int | a_verboseLevel | ) | [inline] |
Set the verbose level.
a_verboseLevel |
Definition at line 112 of file oDeformationManager.hh.
oDeformationManager::UseDeformationCard | ( | ) | [inline] |
Indicate if the cardiac motion deformation is enabled.
Definition at line 164 of file oDeformationManager.hh.
oDeformationManager::UseDeformationInv | ( | ) | [inline] |
Indicate if the involuntary patient motion deformation is enabled.
Definition at line 171 of file oDeformationManager.hh.
oDeformationManager::UseDeformationResp | ( | ) | [inline] |
Indicate if the respiratory motion deformation is enabled.
Definition at line 157 of file oDeformationManager.hh.
bool oDeformationManager::m_checked [private] |
Boolean indicating whether the parameters were checked or not
Definition at line 283 of file oDeformationManager.hh.
int oDeformationManager::m_currentCardGate [private] |
Current gate for the cardiac motion
Definition at line 273 of file oDeformationManager.hh.
int oDeformationManager::m_currentPMotionIndex [private] |
Current gate for the involuntary patient motion
Definition at line 274 of file oDeformationManager.hh.
int oDeformationManager::m_currentRespGate [private] |
Current gate for the respiratory motion
Definition at line 272 of file oDeformationManager.hh.
int oDeformationManager::m_dataMode [private] |
Data mode (list-mode (=0), histogram (=1)). Recovered from the datafile
Definition at line 281 of file oDeformationManager.hh.
bool oDeformationManager::m_initialized [private] |
Boolean indicating whether the manager was initialized or not
Definition at line 285 of file oDeformationManager.hh.
int oDeformationManager::m_nbCardGates [private] |
Number of cardiac gates
Definition at line 277 of file oDeformationManager.hh.
int oDeformationManager::m_nbRespGates [private] |
Number of respiratory gates
Definition at line 276 of file oDeformationManager.hh.
string oDeformationManager::m_optionsCard [private] |
The string containing options for the cardiac motion correction
Definition at line 262 of file oDeformationManager.hh.
string oDeformationManager::m_optionsInv [private] |
The string containing options for the involuntary patient motion correction
Definition at line 263 of file oDeformationManager.hh.
string oDeformationManager::m_optionsResp [private] |
The string containing options for the respiratory motion correction
Definition at line 261 of file oDeformationManager.hh.
bool oDeformationManager::m_UseDeformationCard [private] |
Flag indicating that transformation for cardiac motion is enabled
Definition at line 269 of file oDeformationManager.hh.
bool oDeformationManager::m_UseDeformationInv [private] |
Flag indicating that transformation for involuntary patient motion is enabled
Definition at line 270 of file oDeformationManager.hh.
bool oDeformationManager::m_UseDeformationResp [private] |
Flag indicating that transformation for respiratory motion is enabled
Definition at line 268 of file oDeformationManager.hh.
int oDeformationManager::m_verbose [private] |
The verbose level
Definition at line 279 of file oDeformationManager.hh.
Deformation object for cardiac motion
Definition at line 266 of file oDeformationManager.hh.
Deformation object for involuntary patient motion
Definition at line 267 of file oDeformationManager.hh.
Deformation object for respiratory motion
Definition at line 265 of file oDeformationManager.hh.
Pointer to the oImageDimensionsAndQuantification object in use
Definition at line 259 of file oDeformationManager.hh.