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

This abstract class is the generic image convolver class used by the oImageConvolverManager. More...

#include <vImageConvolver.hh>

Inheritance diagram for vImageConvolver:
Inheritance graph
Collaboration diagram for vImageConvolver:
Collaboration graph

Public Member Functions

 vImageConvolver ()
 The constructor of vImageConvolver. More...
 
virtual ~vImageConvolver ()
 The destructor of vImageConvolver. More...
 
int CheckParameters ()
 A public function used to check the parameters settings. More...
 
int Initialize ()
 A public function used to initialize the module. More...
 
int ApplyConvolution (FLTNB *ap_image)
 A public function used to apply the convolution module on the provided image. More...
 
int ApplyConvolutionTranspose (FLTNB *ap_image)
 A public function used to apply the transpose convolution module on the provided image. More...
 
virtual int ReadConfigurationFile (const string &a_fileOptions)=0
 A function used to read options from a configuration file. More...
 
virtual int ReadOptionsList (const string &a_listOptions)=0
 A function used to read options from a list of options. More...
 
virtual void ShowHelp ()=0
 A function used to show help about the child module. More...
 
void SetVerbose (int a_verbose)
 Set the member m_verboseLevel to the provided value. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 Set the member mp_ImageDimensionsAndQuantification to the provided value. More...
 

Protected Attributes

oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
int m_verbose
 
bool m_checked
 
bool m_initialized
 
bool m_stationary
 
FLTNBmp_paddedImage
 
INTNB m_offsetX
 
INTNB m_offsetY
 
INTNB m_offsetZ
 
INTNB m_dimPadX
 
INTNB m_dimPadY
 
INTNB m_dimPadZ
 
INTNB m_dimPadXY
 
INTNB m_dimPadXYZ
 
INTNB m_nbKernels
 
INTNBmp_dimKernelX
 
INTNBmp_dimKernelY
 
INTNBmp_dimKernelZ
 
FLTNB ** m2p_kernel
 

Private Member Functions

void CopyToPaddedImage (FLTNB *ap_inputImage)
 A private function used to copy the provided image into the padded buffer. More...
 
virtual int Convolve (FLTNB *ap_outputImage)
 A private function used to apply the convolution on the padded image to the provided output image. More...
 
virtual int ConvolveTranspose (FLTNB *ap_outputImage)
 A private function used to apply the transpose convolution on the padded image to the provided output image. More...
 
virtual int CheckSpecificParameters ()=0
 A private function used to check the parameters settings specific to the child convolver. More...
 
virtual int BuildConvolutionKernel ()=0
 A private function used to build the convolution kernel specific to the child convolver. More...
 

Detailed Description

This abstract class is the generic image convolver class used by the oImageConvolverManager.

This abstract class is the base of all implemented image convolvers inheriting from it. It is used by the oImageConvolverManager that instantiate a collection of children objects based on the provided options. It implements four main public functions:
(i) CheckParameters() which checks the mandatory common parameters and calls the pure virtual CheckSpecificParameters() function implemented by each child;
(ii) Initialize() which initializes some common stuff and calls the pure virtual BuildConvolutionKernel() function implemented by each child;
(iii) ApplyConvolution() which actually applies the convolution onto the provided image;
(iv) ApplyConvolutionTranspose() which applies the transpose of the convolution.
It also specifies other pure virtual functions dedicated to the reading of options and help associated to each child, and the Convolve() and ConvolveTranspose() functions which actually implement the specific convolving of each child module. As an example of a child module, see the iImageProcessingTemplate child class that illustrates how a specific image processing module should be implemented.

Definition at line 58 of file vImageConvolver.hh.

Constructor & Destructor Documentation

vImageConvolver::vImageConvolver ( )

The constructor of vImageConvolver.

This is the default and unique constructor. It does not take any parameter and its role is only to affect default values to each member of the class.

Definition at line 40 of file vImageConvolver.cc.

vImageConvolver::~vImageConvolver ( )
virtual

The destructor of vImageConvolver.

This is the default and unique destructor. It does not take any parameter and its role is only to free or delete all structures that were build by this class. It is virtual, so that it is automatically called when a child object is deleted.

Definition at line 72 of file vImageConvolver.cc.

Member Function Documentation

int vImageConvolver::ApplyConvolution ( FLTNB ap_image)

A public function used to apply the convolution module on the provided image.

Parameters
FLTNB*ap_image

This function is the first main action function used to apply the convolution on the provided image. It copy the provided image into the padded image buffer using the CopyToPaddedImage() private function, and then apply the convolution using the private Convolve() function.

Returns
An integer reflecting the convolution status; 0 if no problem, another value otherwise.

Definition at line 240 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vImageConvolver::ApplyConvolutionTranspose ( FLTNB ap_image)

A public function used to apply the transpose convolution module on the provided image.

Parameters
FLTNB*ap_image

This function is the second main action function used to apply the transpose of the convolution on the provided image. It copy the provided image into the padded image buffer using the CopyToPaddedImage() private function, and then apply the transpose of the convolution using the private ConvolveTranspose() function.

Returns
An integer reflecting the convolution status; 0 if no problem, another value otherwise.

Definition at line 267 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

private virtual int vImageConvolver::BuildConvolutionKernel ( )
privatepure virtual

A private function used to build the convolution kernel specific to the child convolver.

This function is used to build the convolution kernels associated to the child convolver. It is called by the Initialize() function. It is pure virtual so is implemented by children. To be the most generic possible, one can build has many convolution kernels as desired in order to implement spatially variant convolutions. The number of kernels should be specified, the kernels' dimensions allocated and specified, and same for the actual kernels' values.

Returns
An integer reflecting the building status; 0 if no problem, another value otherwise.

Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.

Here is the caller graph for this function:

int vImageConvolver::CheckParameters ( )

A public function used to check the parameters settings.

This function does not take any parameter and is used to check that all mandatory members were correctly parameterized. At the end, it calls the pure virtual CheckSpecificParameters() function implemented by children.

Returns
An integer reflecting the check status; 0 if no problem, another value otherwise.

Definition at line 92 of file vImageConvolver.cc.

Here is the call graph for this function:

private virtual int vImageConvolver::CheckSpecificParameters ( )
privatepure virtual

A private function used to check the parameters settings specific to the child convolver.

This function is used to check that all parameters specific to the convolver are correctly set within allowed values. It is called by the CheckParameters() function. It is pure virtual so is implemented by children.

Returns
An integer reflecting the check status; 0 if no problem, another value otherwise.

Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.

Here is the caller graph for this function:

int vImageConvolver::Convolve ( FLTNB ap_outputImage)
privatevirtual

A private function used to apply the convolution on the padded image to the provided output image.

Parameters
FLTNB*ap_outputImage

This function is used to apply the convolution on the padded image to the provided output image. It is virtual so it can be overloaded. The current implementation is valid only for stationary kernels. So for spatially variant kernels, it must be overloaded.

Returns
An integer reflecting the convolution status; 0 if no problem, another value otherwise.

Definition at line 337 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vImageConvolver::ConvolveTranspose ( FLTNB ap_outputImage)
privatevirtual

A private function used to apply the transpose convolution on the padded image to the provided output image.

Parameters
FLTNB*ap_outputImage

This function is used to apply the transpose of the convolution on the padded image to the provided output image. It is virtual so it can be overloaded. The current implementation is valid only for stationary kernels as it simply call the Convolve() function. So for spatially variant kernels, it must be overloaded.

Returns
An integer reflecting the convolution status; 0 if no problem, another value otherwise.

Definition at line 424 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void vImageConvolver::CopyToPaddedImage ( FLTNB ap_inputImage)
private

A private function used to copy the provided image into the padded buffer.

Parameters
FLTNB*ap_inputImage

This function is copies the provided image into the padded image buffer. It is used right before apply the convolution or its transpose.

Definition at line 294 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int vImageConvolver::Initialize ( )

A public function used to initialize the module.

This function does not take any parameter and is used to initialize everything that should be initialized. At the beginning, it calls the pure virtual BuildConvolutionKernel() function implemented by children.

Returns
An integer reflecting the initialization status; 0 if no problem, another value otherwise.

Definition at line 124 of file vImageConvolver.cc.

Here is the call graph for this function:

public virtual int vImageConvolver::ReadConfigurationFile ( const string &  a_fileOptions)
pure virtual

A function used to read options from a configuration file.

Parameters
conststring& a_configurationFile

This function implements the reading of all options associated to a child convolver, from a configuration file. It is pure virtual so is implemented by children. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.

Returns
An integer reflecting the reading success; 0 if success, another value otherwise.

Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.

public virtual int vImageConvolver::ReadOptionsList ( const string &  a_listOptions)
pure virtual

A function used to read options from a list of options.

Parameters
conststring& a_optionsList

This function implements the reading of all options associated to a child convolver, from a list of options. It is pure virtual so is implemented by children. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.

Returns
An integer reflecting the reading success; 0 if success, another value otherwise.

Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.

public void vImageConvolver::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Set the member mp_ImageDimensionsAndQuantification to the provided value.

Parameters
oImageDimensionsAndQuantification*ap_ImageDimensionsAndQuantification

Definition at line 240 of file vImageConvolver.hh.

Here is the caller graph for this function:

public void vImageConvolver::SetVerbose ( int  a_verbose)
inline

Set the member m_verboseLevel to the provided value.

Parameters
inta_verboseLevel

Definition at line 233 of file vImageConvolver.hh.

Here is the caller graph for this function:

public virtual int vImageConvolver::ShowHelp ( )
pure virtual

A function used to show help about the child module.

This function must describe what the module does and how to use it. It describes in details the different parameters of the module, and how to set them through the use of a configuration file or a list of options. It is pure virtual so is implemented by children.

Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.

Here is the caller graph for this function:

Member Data Documentation

FLTNB** vImageConvolver::m2p_kernel
protected

The actual kernels, first pointer for the number of kernels, second pointer for the kernel values

Definition at line 269 of file vImageConvolver.hh.

bool vImageConvolver::m_checked
protected

Boolean that says if the parameters were checked or not

Definition at line 251 of file vImageConvolver.hh.

INTNB vImageConvolver::m_dimPadX
protected

The number of voxels of the padded image along X

Definition at line 259 of file vImageConvolver.hh.

INTNB vImageConvolver::m_dimPadXY
protected

The number of voxels of the padded image in a slice

Definition at line 262 of file vImageConvolver.hh.

INTNB vImageConvolver::m_dimPadXYZ
protected

The total number of voxels of the padded image

Definition at line 263 of file vImageConvolver.hh.

INTNB vImageConvolver::m_dimPadY
protected

The number of voxels of the padded image along Y

Definition at line 260 of file vImageConvolver.hh.

INTNB vImageConvolver::m_dimPadZ
protected

The number of voxels of the padded image along Z

Definition at line 261 of file vImageConvolver.hh.

bool vImageConvolver::m_initialized
protected

Boolean that says if the convolver was initialized or not

Definition at line 252 of file vImageConvolver.hh.

INTNB vImageConvolver::m_nbKernels
protected

The number of kernels (1 if stationary, more otherwise

Definition at line 265 of file vImageConvolver.hh.

INTNB vImageConvolver::m_offsetX
protected

The offset of the padded image along X

Definition at line 256 of file vImageConvolver.hh.

INTNB vImageConvolver::m_offsetY
protected

The offset of the padded image along Y

Definition at line 257 of file vImageConvolver.hh.

INTNB vImageConvolver::m_offsetZ
protected

The offset of the padded image along Z

Definition at line 258 of file vImageConvolver.hh.

bool vImageConvolver::m_stationary
protected

Boolean that says if the kernel is stationary or not

Definition at line 253 of file vImageConvolver.hh.

int vImageConvolver::m_verbose
protected

The verbose level

Definition at line 249 of file vImageConvolver.hh.

INTNB* vImageConvolver::mp_dimKernelX
protected

The dimension of each kernel along X

Definition at line 266 of file vImageConvolver.hh.

INTNB* vImageConvolver::mp_dimKernelY
protected

The dimension of each kernel along Y

Definition at line 267 of file vImageConvolver.hh.

INTNB* vImageConvolver::mp_dimKernelZ
protected

The dimension of each kernel along Z

Definition at line 268 of file vImageConvolver.hh.

oImageDimensionsAndQuantification* vImageConvolver::mp_ImageDimensionsAndQuantification
protected

Pointer to the oImageDimensionsAndQuantification object in use

Definition at line 248 of file vImageConvolver.hh.

FLTNB* vImageConvolver::mp_paddedImage
protected

The actual padded buffer image

Definition at line 255 of file vImageConvolver.hh.


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