CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
iDeformationRigid Class Reference

This class performs rigid transformation based on a trilinear interpolation It requires ASCII parameter files containing x,y,z transformation vectors. More...

#include <iDeformationRigid.hh>

Inheritance diagram for iDeformationRigid:
Inheritance graph
Collaboration diagram for iDeformationRigid:
Collaboration graph

Public Member Functions

 iDeformationRigid ()
 Constructor of iDeformationRigid. Simply set all data members to default values. More...
 
 ~iDeformationRigid ()
 Destructor of iDeformationRigid. Free memory from all allocated tabs. More...
 
int ReadAndCheckConfigurationFile (const string &a_fileOptions)
 
int ReadAndCheckOptionsList (const string &a_listOptions)
 
int CheckSpecificParameters ()
 This function is used to check parameters after the latter have been all set using Set functions. More...
 
int Initialize ()
 This function is used to initialize specific stuff in the deformation model. More...
 
void ShowHelp ()
 This function is used to print out specific help about the deformation and its options. More...
 
int ApplyDeformations (FLTNB *ap_inputImage, FLTNB *ap_outputImage, int a_direction, int a_defIdx)
 
 iDeformationRigid ()
 
 ~iDeformationRigid ()
 
int ReadAndCheckConfigurationFile (const string &a_fileOptions)
 
int ReadAndCheckOptionsList (const string &a_listOptions)
 
int CheckSpecificParameters ()
 This function is used to check the parameters of the child functions before initialization if required. More...
 
int Initialize ()
 This function is used to initialize specific data related to the child deformation model.
It is pure virtual so must be implemented by children. More...
 
void ShowHelp ()
 This function is used to print out specific help about the deformation and its options.
It is pure virtual so must be implemented by children. More...
 
int ApplyDeformations (FLTNB *ap_inputImage, FLTNB *ap_outputImage, int a_direction, int a_defIdx)
 
- Public Member Functions inherited from vDeformation
 vDeformation ()
 Constructor of vDeformation. Simply set all data members to default values. More...
 
virtual ~vDeformation ()
 Destructor of vDeformation. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 
void SetVerbose (int a_verbose)
 
void SetNbTransformations (int a_nbTransformations)
 
virtual int CheckParameters ()
 This function is used to check parameters after the latter have been all set using Set functions. More...
 
virtual int PerformDeformation (oImageSpace *ap_Image, int a_defIdx, int a_fr, int a_rimg, int a_cimg)
 
virtual int PerformHistoSensitivityDeformation (oImageSpace *ap_Image, int a_defIdx, int fr, int rimg, int cimg)
 
virtual int ApplyDeformationsToBackwardImage (oImageSpace *ap_Image, int a_fr, int a_defIdx)
 
virtual int ApplyDeformationsToHistoSensitivityImage (oImageSpace *ap_Image, int a_fr, int a_defIdx)
 
virtual int PerformSensitivityDeformation (oImageSpace *ap_Image, int a_defDirection, int a_defIdx, int fr, int rg, int cg)
 
int Tlerp (HPFLTNB *ap_inputImage, HPFLTNB *ap_outputImage, uint32_t iov, uint32_t iiv, FLTNB dX, FLTNB dY, FLTNB dZ)
 
 vDeformation ()
 
virtual ~vDeformation ()
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 
void SetVerbose (int a_verbose)
 
void SetNbTransformations (int a_nbTransformations)
 
virtual int CheckParameters ()
 
virtual int PerformDeformation (oImageSpace *ap_Image, int a_defIdx, int a_fr, int a_rimg, int a_cimg)
 
virtual int PerformHistoSensitivityDeformation (oImageSpace *ap_Image, int a_defIdx, int fr, int rimg, int cimg)
 
virtual int ApplyDeformationsToBackwardImage (oImageSpace *ap_Image, int a_fr, int a_defIdx)
 
virtual int ApplyDeformationsToHistoSensitivityImage (oImageSpace *ap_Image, int a_fr, int a_defIdx)
 
virtual int PerformSensitivityDeformation (oImageSpace *ap_Image, int a_defDirection, int a_defIdx, int fr, int rg, int cg)
 
int Tlerp (HPFLTNB *ap_inputImage, HPFLTNB *ap_outputImage, uint32_t iov, uint32_t iiv, FLTNB dX, FLTNB dY, FLTNB dZ)
 

Private Member Functions

int TransformImage (int a_direction, int a_defIdx, HPFLTNB *ap_inputImage, HPFLTNB *ap_outputImage)
 
int ComputeTransformationMatrices ()
 Initialize transformation matrices from parameters. More...
 
int SetRotationMatrix (oMatrix *apRotMtx, FLTNB a_ang1, FLTNB a_ang2, FLTNB a_ang3, string a_cvt)
 This function set the rotation matrix passed in parameter with the provided angles in radian and rotation convention. More...
 
int TransformImage (int a_direction, int a_defIdx, HPFLTNB *ap_inputImage, HPFLTNB *ap_outputImage)
 
int ComputeTransformationMatrices ()
 
int SetRotationMatrix (oMatrix *apRotMtx, FLTNB a_ang1, FLTNB a_ang2, FLTNB a_ang3, string a_cvt)
 

Private Attributes

vector< string > m_pathToFwdDeformationFiles
 
vector< string > m_pathToBwdDeformationFiles
 
HPFLTNBmp_OriginalArray
 
HPFLTNBmp_OutputArray
 
HPFLTNBmp_tX
 
HPFLTNBmp_tY
 
HPFLTNBmp_tZ
 
HPFLTNBmp_rA
 
HPFLTNBmp_rB
 
HPFLTNBmp_rC
 
oMatrix ** m2p_FTmtx
 
oMatrix ** m2p_BTmtx
 
string m_rotConvention
 
bool m_cmpTransfoFlag
 

Additional Inherited Members

- Protected Attributes inherited from vDeformation
oImageDimensionsAndQuantificationmp_ID
 
int m_verbose
 
int m_nbTransformations
 
int m_checked
 
int m_initialized
 

Detailed Description

This class performs rigid transformation based on a trilinear interpolation It requires ASCII parameter files containing x,y,z transformation vectors.

TODO

Definition at line 22 of file code/include/image/iDeformationRigid.hh.

Constructor & Destructor Documentation

◆ iDeformationRigid() [1/2]

iDeformationRigid::iDeformationRigid ( )

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

Definition at line 18 of file code/src/image/iDeformationRigid.cc.

◆ ~iDeformationRigid() [1/2]

iDeformationRigid::~iDeformationRigid ( )

Destructor of iDeformationRigid. Free memory from all allocated tabs.

Definition at line 45 of file code/src/image/iDeformationRigid.cc.

◆ iDeformationRigid() [2/2]

iDeformationRigid::iDeformationRigid ( )

◆ ~iDeformationRigid() [2/2]

iDeformationRigid::~iDeformationRigid ( )

Member Function Documentation

◆ ApplyDeformations() [1/2]

int iDeformationRigid::ApplyDeformations ( FLTNB ap_inputImage,
FLTNB ap_outputImage,
int  a_direction,
int  a_defIdx 
)
virtual

Implements vDeformation.

Definition at line 478 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:

◆ ApplyDeformations() [2/2]

int iDeformationRigid::ApplyDeformations ( FLTNB ap_inputImage,
FLTNB ap_outputImage,
int  a_direction,
int  a_defIdx 
)
virtual

Implements vDeformation.

◆ CheckSpecificParameters() [1/2]

int iDeformationRigid::CheckSpecificParameters ( )
virtual

This function is used to check the parameters of the child functions before initialization if required.

It could be overloaded by the child if needed. Default implementation is empty and return 0.

Returns
0 if success, other value otherwise.

Implements vDeformation.

◆ CheckSpecificParameters() [2/2]

int iDeformationRigid::CheckSpecificParameters ( )
virtual

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

Returns
0 if success, positive value otherwise.

Implements vDeformation.

Definition at line 410 of file code/src/image/iDeformationRigid.cc.

◆ ComputeTransformationMatrices() [1/2]

int iDeformationRigid::ComputeTransformationMatrices ( )
private

Initialize transformation matrices from parameters.

Returns
0 if success, positive value otherwise.

Definition at line 293 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTransformationMatrices() [2/2]

int iDeformationRigid::ComputeTransformationMatrices ( )
private

◆ Initialize() [1/2]

int iDeformationRigid::Initialize ( )
virtual

This function is used to initialize specific stuff in the deformation model.

Allocate memory for image matrices, and initialize images containing transformation parameters

Returns
0 if success, other value otherwise.

Implements vDeformation.

Definition at line 441 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:

◆ Initialize() [2/2]

int iDeformationRigid::Initialize ( )
virtual

This function is used to initialize specific data related to the child deformation model.
It is pure virtual so must be implemented by children.

Returns
0 if success, other value otherwise.

Implements vDeformation.

◆ ReadAndCheckConfigurationFile() [1/2]

int iDeformationRigid::ReadAndCheckConfigurationFile ( const string &  a_fileOptions)
virtual

Implements vDeformation.

◆ ReadAndCheckConfigurationFile() [2/2]

int iDeformationRigid::ReadAndCheckConfigurationFile ( const string &  a_fileOptions)
virtual

Implements vDeformation.

Definition at line 136 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:

◆ ReadAndCheckOptionsList() [1/2]

int iDeformationRigid::ReadAndCheckOptionsList ( const string &  a_listOptions)
virtual

Implements vDeformation.

◆ ReadAndCheckOptionsList() [2/2]

int iDeformationRigid::ReadAndCheckOptionsList ( const string &  a_listOptions)
virtual

Implements vDeformation.

Definition at line 224 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:

◆ SetRotationMatrix() [1/2]

int iDeformationRigid::SetRotationMatrix ( oMatrix apRotMtx,
FLTNB  a_ang1,
FLTNB  a_ang2,
FLTNB  a_ang3,
string  a_cvt 
)
private

This function set the rotation matrix passed in parameter with the provided angles in radian and rotation convention.

Parameters
apRotMtx: Rotation oMatrix to initialize
a_ang1: 1st rotation angle (rad)
a_ang2: 2nd rotation angle (rad)
a_ang3: 3rd rotation angle (rad)
a_cvt: rotation convention (must be any combinations of 'x', 'y', and 'z'. (Default: xyz) )
Returns
0 if success, other value otherwise.
Parameters
apRotMtx: Rotation oMatrix to initialize
a_ang1: 1st rotation angle (rad)
a_ang2: 2nd rotation angle (rad)
a_ang3: 3rd rotation angle (rad)
a_cvt: rotation convention (must be any combinations of 'x', 'y', and 'z'. (Default: xyz) )
Returns
0 if success, other value otherwise.

Definition at line 620 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetRotationMatrix() [2/2]

int iDeformationRigid::SetRotationMatrix ( oMatrix apRotMtx,
FLTNB  a_ang1,
FLTNB  a_ang2,
FLTNB  a_ang3,
string  a_cvt 
)
private

◆ ShowHelp() [1/2]

void iDeformationRigid::ShowHelp ( )
virtual

This function is used to print out specific help about the deformation and its options.
It is pure virtual so must be implemented by children.

Implements vDeformation.

◆ ShowHelp() [2/2]

void iDeformationRigid::ShowHelp ( )
virtual

This function is used to print out specific help about the deformation and its options.

Implements vDeformation.

Definition at line 83 of file code/src/image/iDeformationRigid.cc.

◆ TransformImage() [1/2]

int iDeformationRigid::TransformImage ( int  a_direction,
int  a_defIdx,
HPFLTNB ap_inputImage,
HPFLTNB ap_outputImage 
)
private

◆ TransformImage() [2/2]

int iDeformationRigid::TransformImage ( int  a_direction,
int  a_defIdx,
HPFLTNB ap_inputImage,
HPFLTNB ap_outputImage 
)
private

Definition at line 530 of file code/src/image/iDeformationRigid.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m2p_BTmtx

oMatrix ** iDeformationRigid::m2p_BTmtx
private

Backward transformation matrix

Definition at line 153 of file code/include/image/iDeformationRigid.hh.

◆ m2p_FTmtx

oMatrix ** iDeformationRigid::m2p_FTmtx
private

Forward transformation matrix

Definition at line 152 of file code/include/image/iDeformationRigid.hh.

◆ m_cmpTransfoFlag

bool iDeformationRigid::m_cmpTransfoFlag
private

Flag defining if transformations from reference to each position must be computed (provided transformation parameters from one position to the next one, default) or not (already computed by the user)

Definition at line 155 of file code/include/image/iDeformationRigid.hh.

◆ m_pathToBwdDeformationFiles

vector< string > iDeformationRigid::m_pathToBwdDeformationFiles
private

Containers of the location of backward deformation file. Nb of elements should be equal to the number of transformations 'm_nbTransformations'

Definition at line 142 of file code/include/image/iDeformationRigid.hh.

◆ m_pathToFwdDeformationFiles

vector< string > iDeformationRigid::m_pathToFwdDeformationFiles
private

Containers of the location of forward deformation file. Nb of elements should be equal to the number of transformations 'm_nbTransformations'

Definition at line 139 of file code/include/image/iDeformationRigid.hh.

◆ m_rotConvention

string iDeformationRigid::m_rotConvention
private

Convention for rotation. Default : XYZ

Definition at line 154 of file code/include/image/iDeformationRigid.hh.

◆ mp_OriginalArray

HPFLTNB * iDeformationRigid::mp_OriginalArray
private

Image matrice to get the input image for deformation

Definition at line 144 of file code/include/image/iDeformationRigid.hh.

◆ mp_OutputArray

HPFLTNB * iDeformationRigid::mp_OutputArray
private

Image matrice to recover the output image after deformation

Definition at line 145 of file code/include/image/iDeformationRigid.hh.

◆ mp_rA

HPFLTNB * iDeformationRigid::mp_rA
private

First rotation

Definition at line 149 of file code/include/image/iDeformationRigid.hh.

◆ mp_rB

HPFLTNB * iDeformationRigid::mp_rB
private

Second rotation

Definition at line 150 of file code/include/image/iDeformationRigid.hh.

◆ mp_rC

HPFLTNB * iDeformationRigid::mp_rC
private

Third rotation

Definition at line 151 of file code/include/image/iDeformationRigid.hh.

◆ mp_tX

HPFLTNB * iDeformationRigid::mp_tX
private

Translation on the X-axis

Definition at line 146 of file code/include/image/iDeformationRigid.hh.

◆ mp_tY

HPFLTNB * iDeformationRigid::mp_tY
private

Translation on the Y-axis

Definition at line 147 of file code/include/image/iDeformationRigid.hh.

◆ mp_tZ

HPFLTNB * iDeformationRigid::mp_tZ
private

Translation on the Z-axis

Definition at line 148 of file code/include/image/iDeformationRigid.hh.


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