CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
Public Member Functions | Protected Attributes | Private Member Functions
vImageConvolver Class Reference

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

#include <vImageConvolver.hh>

Inheritance diagram for vImageConvolver:
Inheritance graph
[legend]
Collaboration diagram for vImageConvolver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

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.
virtual int Convolve (FLTNB *ap_outputImage)
 A private function used to apply the convolution on the padded image to the provided output image.
virtual int ConvolveTranspose (FLTNB *ap_outputImage)
 A private function used to apply the transpose convolution on the padded image to the provided output image.
virtual int CheckSpecificParameters ()=0
 A private function used to check the parameters settings specific to the child convolver.
virtual int BuildConvolutionKernel ()=0
 A private function used to build the convolution kernel specific to the child convolver.

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 37 of file vImageConvolver.hh.


Constructor & Destructor Documentation

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 27 of file vImageConvolver.cc.

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 59 of file vImageConvolver.cc.


Member Function Documentation

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 227 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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 254 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 ( ) [private, pure 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:

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 79 of file vImageConvolver.cc.

Here is the call graph for this function:

private virtual int vImageConvolver::CheckSpecificParameters ( ) [private, pure 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) [private, virtual]

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 324 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) [private, virtual]

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 411 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 281 of file vImageConvolver.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

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 111 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 219 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 212 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

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

Definition at line 248 of file vImageConvolver.hh.

bool vImageConvolver::m_checked [protected]

Boolean that says if the parameters were checked or not

Definition at line 230 of file vImageConvolver.hh.

The number of voxels of the padded image along X

Definition at line 238 of file vImageConvolver.hh.

The number of voxels of the padded image in a slice

Definition at line 241 of file vImageConvolver.hh.

The total number of voxels of the padded image

Definition at line 242 of file vImageConvolver.hh.

The number of voxels of the padded image along Y

Definition at line 239 of file vImageConvolver.hh.

The number of voxels of the padded image along Z

Definition at line 240 of file vImageConvolver.hh.

Boolean that says if the convolver was initialized or not

Definition at line 231 of file vImageConvolver.hh.

The number of kernels (1 if stationary, more otherwise

Definition at line 244 of file vImageConvolver.hh.

The offset of the padded image along X

Definition at line 235 of file vImageConvolver.hh.

The offset of the padded image along Y

Definition at line 236 of file vImageConvolver.hh.

The offset of the padded image along Z

Definition at line 237 of file vImageConvolver.hh.

Boolean that says if the kernel is stationary or not

Definition at line 232 of file vImageConvolver.hh.

int vImageConvolver::m_verbose [protected]

The verbose level

Definition at line 228 of file vImageConvolver.hh.

The dimension of each kernel along X

Definition at line 245 of file vImageConvolver.hh.

The dimension of each kernel along Y

Definition at line 246 of file vImageConvolver.hh.

The dimension of each kernel along Z

Definition at line 247 of file vImageConvolver.hh.

Pointer to the oImageDimensionsAndQuantification object in use

Definition at line 227 of file vImageConvolver.hh.

The actual padded buffer image

Definition at line 234 of file vImageConvolver.hh.


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