CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
Public Member Functions | Private Member Functions | Private Attributes
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
[legend]
Collaboration diagram for iDeformationRigid:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 iDeformationRigid ()
 Constructor of iDeformationRigid. Simply set all data members to default values.
 ~iDeformationRigid ()
 Destructor of iDeformationRigid. Free memory from all allocated tabs.
int ReadAndCheckConfigurationFile (const string &a_fileOptions)
 This function is used to read options from a configuration file.
int ReadAndCheckOptionsList (const string &a_listOptions)
 This function is used to read options from a list of options. Throw error by defaut for this method, as a file has to be used for initialization.
int CheckSpecificParameters ()
 This function is used to check parameters after the latter have been all set using Set functions.
int Initialize ()
 This function is used to initialize specific stuff in the deformation model.
void ShowHelp ()
 This function is used to print out specific help about the deformation and its options.
int ApplyDeformations (FLTNB *ap_inputImage, FLTNB *ap_outputImage, int a_direction, int a_defIdx)
 This function prepares the deformation to perform.

Private Member Functions

int WarpImage (string a_vectorFileIdx, double *ap_inputImage, double *ap_outputImage)
 This function performs a rigid transformation using x,y,z displacement vectors and trilinear interpolation
.
int LoadVectorFiles (string a_vectorFileIdx)
 Load the transformation parameters from an ASCII file provided in argument.

Private Attributes

vector< string > m_pathToFwdDeformationFiles
vector< string > m_pathToBwdDeformationFiles
double * m_OriginalArray
double * m_OutputArray
FLTNBmp_vectorX
FLTNBmp_vectorY
FLTNBmp_vectorZ

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 iDeformationRigid.hh.


Constructor & Destructor Documentation

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

Definition at line 29 of file iDeformationRigid.cc.

Destructor of iDeformationRigid. Free memory from all allocated tabs.

Definition at line 51 of file iDeformationRigid.cc.


Member Function Documentation

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

This function prepares the deformation to perform.

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

1. Selects the right deformation parameters file according to the direction and deformation index argument
2. Copy the image to deform in the buffer image of this class
3. Call the deformation function (WarpImage)
4. Copy back the output of the deformation image to the output image matrice passed in argument

Returns:
0 if success, other value otherwise.

Implements vDeformation.

Definition at line 310 of file iDeformationRigid.cc.

Here is the call graph for this function:

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 234 of file iDeformationRigid.cc.

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 263 of file iDeformationRigid.cc.

Here is the call graph for this function:

int iDeformationRigid::LoadVectorFiles ( string  a_vectorFileIdx) [private]

Load the transformation parameters from an ASCII file provided in argument.

Parameters:
a_vectorFileIdx: deformation parameters file
Returns:
0 if success, other value otherwise.

Definition at line 461 of file iDeformationRigid.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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

This function is used to read options from a configuration file.

Parameters:
a_configurationFile
Returns:
0 if success, other value otherwise.

Implements vDeformation.

Definition at line 124 of file iDeformationRigid.cc.

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

This function is used to read options from a list of options. Throw error by defaut for this method, as a file has to be used for initialization.

Parameters:
a_optionsList
Returns:
0 if success, other value otherwise.

Implements vDeformation.

Definition at line 216 of file iDeformationRigid.cc.

void iDeformationRigid::ShowHelp ( ) [virtual]

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

Implements vDeformation.

Definition at line 76 of file iDeformationRigid.cc.

int iDeformationRigid::WarpImage ( string  a_vectorFileIdx,
double *  ap_inputImage,
double *  ap_outputImage 
) [private]

This function performs a rigid transformation using x,y,z displacement vectors and trilinear interpolation
.

Parameters:
a_vectorFileIdx: deformation vector file
ap_inputImage: image on which the deformation should be performed
ap_outputImage: matrice which recovers the image after deformation

1. Load the X,Y,Z transformation vectors from the file passed in argument 2. Loop on the voxels and compute the new voxels value using trilinear interpolation

Returns:
0 if success, other value otherwise.

Definition at line 370 of file iDeformationRigid.cc.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Image matrice to get the input image for deformation

Definition at line 128 of file iDeformationRigid.hh.

Image matrice to recover the output image after deformation

Definition at line 129 of file iDeformationRigid.hh.

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

Definition at line 126 of file iDeformationRigid.hh.

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

Definition at line 123 of file iDeformationRigid.hh.

Image containing transformation parameters on the X-axis

Definition at line 130 of file iDeformationRigid.hh.

Image containing transformation parameters on the Y-axis

Definition at line 131 of file iDeformationRigid.hh.

Image containing transformation parameters on the Z-axis

Definition at line 132 of file iDeformationRigid.hh.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines