CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
oDeformationManager Class Reference

This class is designed to manage the image-based deformation part of the reconstruction. More...

#include <oDeformationManager.hh>

Collaboration diagram for oDeformationManager:
Collaboration graph

Public Member Functions

 oDeformationManager ()
 Constructor of oDeformationManager. Simply set all data members to default values. More...
 
 ~oDeformationManager ()
 Destructor of oDeformationManager. Free memory from all allocated tabs. More...
 
int CheckParameters ()
 This function is used to check parameters after the latter have been all set using Set functions. More...
 
int Initialize ()
 Set the flags for the different motion types and instanciate/initialize deformation objects through the ParseOptionsAndInitializeDeformations() private function. More...
 
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. More...
 
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. More...
 
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. More...
 
void SetVerbose (int a_verboseLevel)
 Set the verbose level. More...
 
void SetDataMode (int a_dataMode)
 Set the mode of reconstruction. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 Set the image dimensions in use. More...
 
void SetOptions (const string &a_options)
 Set the motion options contained in the provided string, and the related number of gates. More...
 
void SetNbTransformations (int a_nbTransformations)
 Set the total number of transformations/deformations. More...
 
void SetMotionType (int a_motionType)
 Set the nature of motion correction (Deformation type macro) More...
 
bool UseDeformationResp ()
 Indicate if the respiratory motion deformation is enabled. More...
 
bool UseDeformationCard ()
 Indicate if the cardiac motion deformation is enabled. More...
 
bool UseDeformationInv ()
 Indicate if the involuntary patient motion deformation is enabled. More...
 
int GetNbSensImagesRespDeformation (int a_value)
 return the required number of respiratory images in the sensitivity image depending on the respiratory deformation model More...
 
int GetNbSensImagesCardDeformation (int a_value)
 return the required number of cardiac images in the sensitivity image depending on the cardiac deformation model More...
 
int ApplyDeformationForSensitivityGeneration (oImageSpace *ap_Image, int a_defDirection, int idx, int fr, int rg, int cg)
 Apply deformations during the list-mode sensitivity image generation. More...
 
int ApplyDeformationsToBackwardImage (oImageSpace *ap_Image)
 Apply final backward deformations on the backward image. More...
 
int PerformDeformation (oImageSpace *ap_Image)
 Apply deformations during reconstruction. More...
 
int TestDeformationOnImage (FLTNB *ap_inputImage, FLTNB *ap_outputImage, int a_direction, int a_defIdx)
 Apply deformation specified by arguments on provided input image, for testing purposes. More...
 

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. More...
 

Private Attributes

oImageDimensionsAndQuantificationmp_ID
 
string m_options
 
vDeformationmp_Deformation
 
bool m_UseDeformationResp
 
bool m_UseDeformationCard
 
bool m_UseDeformationIPat
 
int m_curMotIdx
 
int16_t * mp_curPatMotIdx
 
int m_nbTransformations
 
int m_verbose
 
int m_dataMode
 
bool m_checked
 
bool m_initialized
 

Detailed Description

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 73 of file oDeformationManager.hh.

Constructor & Destructor Documentation

oDeformationManager::oDeformationManager ( )

Constructor of oDeformationManager. Simply set all data members to default values.

Definition at line 42 of file oDeformationManager.cc.

oDeformationManager::~oDeformationManager ( )

Destructor of oDeformationManager. Free memory from all allocated tabs.

Definition at line 79 of file oDeformationManager.cc.

Member Function Documentation

int oDeformationManager::ApplyDeformationForSensitivityGeneration ( oImageSpace ap_Image,
int  a_defDirection,
int  idx,
int  fr,
int  rg,
int  cg 
)

Apply deformations during the list-mode sensitivity image generation.

Parameters
oImageSpace*ap_Image : required to access oImageSpace image matrices
inta_defDirection : direction of the deformation (forward/backward)
inta_defType : Nature of the motion (Respiratory/Cardiac/Involuntary Patient)
intidx
intfr
intrg
intcg

Perform deformation 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 424 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oDeformationManager::ApplyDeformationsToBackwardImage ( oImageSpace ap_Image)

Apply final backward deformations on the backward image.

Parameters
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)

Returns
0 if success, positive value otherwise

Definition at line 583 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oDeformationManager::CheckParameters ( )

This function is used to check parameters after the latter have been all set using Set functions.

Returns
0 if success, positive value otherwise.

Definition at line 126 of file oDeformationManager.cc.

Here is the caller graph for this function:

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.

Parameters
oImageSpace*ap_Image : required to call oImageSpace deallocation functions

Definition at line 364 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

oDeformationManager::GetNbSensImagesCardDeformation ( int  a_value)
inline

return the required number of cardiac images in the sensitivity image depending on the cardiac deformation model

Parameters
a_value: default number of cardiac images
Returns
a number of images

Definition at line 216 of file oDeformationManager.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

oDeformationManager::GetNbSensImagesRespDeformation ( int  a_value)
inline

return the required number of respiratory images in the sensitivity image depending on the respiratory deformation model

Parameters
a_value: default number of cardiac images
Returns
a number of images

Definition at line 206 of file oDeformationManager.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

int oDeformationManager::Initialize ( )

Set the flags for the different motion types and instanciate/initialize deformation objects through the ParseOptionsAndInitializeDeformations() private function.

Returns
0 if success, positive value otherwise.

Definition at line 170 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
oImageSpace*ap_Image : required to call oImageSpace initialization functions

Definition at line 389 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
oImageSpace*ap_Image : required to call oImageSpace instanciation functions

Definition at line 341 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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

  • or - as many ',' as needed parameters for this deformation.
    Specific pure virtual functions of the vDeformation are used to read parameters and initialize them.

Definition at line 224 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int oDeformationManager::PerformDeformation ( oImageSpace ap_Image)

Apply deformations during reconstruction.

Parameters
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 483 of file oDeformationManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

oDeformationManager::SetDataMode ( int  a_dataMode)
inline

Set the mode of reconstruction.

Parameters
a_dataMode: (histogram/list-mode)

required to enable/disable sensitivity image deformation in histogram mode

Definition at line 146 of file oDeformationManager.hh.

Here is the caller graph for this function:

oDeformationManager::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Set the image dimensions in use.

Parameters
ap_ImageDimensionsAndQuantification

Definition at line 153 of file oDeformationManager.hh.

Here is the caller graph for this function:

void oDeformationManager::SetMotionType ( int  a_motionType)

Set the nature of motion correction (Deformation type macro)

Parameters
a_motionType

Definition at line 99 of file oDeformationManager.cc.

Here is the caller graph for this function:

oDeformationManager::SetNbTransformations ( int  a_nbTransformations)
inline

Set the total number of transformations/deformations.

Parameters
a_nbTransformations

Definition at line 169 of file oDeformationManager.hh.

Here is the caller graph for this function:

oDeformationManager::SetOptions ( const string &  a_options)
inline

Set the motion options contained in the provided string, and the related number of gates.

Parameters
a_options
a_nbGates

Definition at line 161 of file oDeformationManager.hh.

Here is the caller graph for this function:

oDeformationManager::SetVerbose ( int  a_verboseLevel)
inline

Set the verbose level.

Parameters
a_verboseLevel

Definition at line 138 of file oDeformationManager.hh.

Here is the caller graph for this function:

int oDeformationManager::TestDeformationOnImage ( FLTNB ap_inputImage,
FLTNB ap_outputImage,
int  a_direction,
int  a_defIdx 
)

Apply deformation specified by arguments on provided input image, for testing purposes.

Parameters
ap_inputImage: input image to deform
ap_outputImage: image in which the output of the deformation should be recovered
a_direction: a direction for the deformation to perform (forward or backward)
a_defIdx: index of the deformation
Returns
0 if success, positive value otherwise

Definition at line 658 of file oDeformationManager.cc.

Here is the call graph for this function:

oDeformationManager::UseDeformationCard ( )
inline

Indicate if the cardiac motion deformation is enabled.

Returns
true if enabled, false otherwise

Definition at line 191 of file oDeformationManager.hh.

Here is the caller graph for this function:

oDeformationManager::UseDeformationInv ( )
inline

Indicate if the involuntary patient motion deformation is enabled.

Returns
true if enabled, false otherwise

Definition at line 198 of file oDeformationManager.hh.

Here is the caller graph for this function:

oDeformationManager::UseDeformationResp ( )
inline

Indicate if the respiratory motion deformation is enabled.

Returns
true if enabled, false otherwise

Definition at line 184 of file oDeformationManager.hh.

Here is the caller graph for this function:

Member Data Documentation

bool oDeformationManager::m_checked
private

Boolean indicating whether the parameters were checked or not

Definition at line 313 of file oDeformationManager.hh.

int oDeformationManager::m_curMotIdx
private

Current gate for the motion

Definition at line 302 of file oDeformationManager.hh.

int oDeformationManager::m_dataMode
private

Data mode (list-mode (=0), histogram (=1)). Recovered from the datafile

Definition at line 311 of file oDeformationManager.hh.

bool oDeformationManager::m_initialized
private

Boolean indicating whether the manager was initialized or not

Definition at line 315 of file oDeformationManager.hh.

int oDeformationManager::m_nbTransformations
private

Number of image-based transformations/deformations

Definition at line 306 of file oDeformationManager.hh.

string oDeformationManager::m_options
private

The string containing options for the motion correction

Definition at line 293 of file oDeformationManager.hh.

bool oDeformationManager::m_UseDeformationCard
private

Flag indicating that transformation for cardiac motion is enabled

Definition at line 298 of file oDeformationManager.hh.

bool oDeformationManager::m_UseDeformationIPat
private

Flag indicating that transformation for involuntary patient motion is enabled

Definition at line 299 of file oDeformationManager.hh.

bool oDeformationManager::m_UseDeformationResp
private

Flag indicating that transformation for respiratory motion is enabled

Definition at line 297 of file oDeformationManager.hh.

int oDeformationManager::m_verbose
private

The verbose level

Definition at line 309 of file oDeformationManager.hh.

int16_t* oDeformationManager::mp_curPatMotIdx
private

Current index for the ip motion by frame

Definition at line 303 of file oDeformationManager.hh.

vDeformation* oDeformationManager::mp_Deformation
private

Deformation object for image-based motion

Definition at line 296 of file oDeformationManager.hh.

oImageDimensionsAndQuantification* oDeformationManager::mp_ID
private

Pointer to the oImageDimensionsAndQuantification object in use

Definition at line 291 of file oDeformationManager.hh.


The documentation for this class was generated from the following files: