CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Protected 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)
 
int ApplyConvolutionTranspose (FLTNB *ap_image)
 
virtual int ReadConfigurationFile (const string &a_fileOptions)=0
 
virtual int ReadOptionsList (const string &a_listOptions)=0
 
virtual void ShowHelp ()=0
 A function used to show help about the child module. More...
 
void SetVerbose (int a_verbose)
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 
 vImageConvolver ()
 
virtual ~vImageConvolver ()
 
int CheckParameters ()
 
int Initialize ()
 
int ApplyConvolution (FLTNB *ap_image)
 
int ApplyConvolutionTranspose (FLTNB *ap_image)
 
virtual int ReadConfigurationFile (const string &a_fileOptions)=0
 
virtual int ReadOptionsList (const string &a_listOptions)=0
 
virtual void ShowHelp ()=0
 
void SetVerbose (int a_verbose)
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 

Protected Member Functions

void CopyToPaddedImage (FLTNB *ap_inputImage)
 
void CopyToPaddedImage (FLTNB *ap_inputImage)
 

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

virtual int Convolve (FLTNB *ap_outputImage)
 
virtual int ConvolveTranspose (FLTNB *ap_outputImage)
 
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...
 
virtual int Convolve (FLTNB *ap_outputImage)
 
virtual int ConvolveTranspose (FLTNB *ap_outputImage)
 
virtual int CheckSpecificParameters ()=0
 
virtual int BuildConvolutionKernel ()=0
 

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 35 of file code/include/image/vImageConvolver.hh.

Constructor & Destructor Documentation

◆ vImageConvolver() [1/2]

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 17 of file code/src/image/vImageConvolver.cc.

◆ ~vImageConvolver() [1/2]

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 49 of file code/src/image/vImageConvolver.cc.

◆ vImageConvolver() [2/2]

vImageConvolver::vImageConvolver ( )

◆ ~vImageConvolver() [2/2]

virtual vImageConvolver::~vImageConvolver ( )
virtual

Member Function Documentation

◆ ApplyConvolution() [1/2]

int vImageConvolver::ApplyConvolution ( FLTNB ap_image)

Definition at line 217 of file code/src/image/vImageConvolver.cc.

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

◆ ApplyConvolution() [2/2]

int vImageConvolver::ApplyConvolution ( FLTNB ap_image)

◆ ApplyConvolutionTranspose() [1/2]

int vImageConvolver::ApplyConvolutionTranspose ( FLTNB ap_image)

Definition at line 244 of file code/src/image/vImageConvolver.cc.

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

◆ ApplyConvolutionTranspose() [2/2]

int vImageConvolver::ApplyConvolutionTranspose ( FLTNB ap_image)

◆ BuildConvolutionKernel() [1/2]

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, iImageConvolverTemplate, iImageConvolverStationaryIsotropicGaussian, iImageConvolverStationaryIsotropicGaussian, iImageConvolverStationaryGaussian, and iImageConvolverStationaryGaussian.

Here is the caller graph for this function:

◆ BuildConvolutionKernel() [2/2]

virtual int vImageConvolver::BuildConvolutionKernel ( )
privatepure virtual

◆ CheckParameters() [1/2]

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 69 of file code/src/image/vImageConvolver.cc.

Here is the call graph for this function:

◆ CheckParameters() [2/2]

int vImageConvolver::CheckParameters ( )

◆ CheckSpecificParameters() [1/2]

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 iImageConvolverStationaryIsotropicGaussian, iImageConvolverTemplate, iImageConvolverStationaryIsotropicGaussian, iImageConvolverTemplate, iImageConvolverStationaryGaussian, and iImageConvolverStationaryGaussian.

Here is the caller graph for this function:

◆ CheckSpecificParameters() [2/2]

virtual int vImageConvolver::CheckSpecificParameters ( )
privatepure virtual

◆ Convolve() [1/2]

virtual int vImageConvolver::Convolve ( FLTNB ap_outputImage)
privatevirtual

◆ Convolve() [2/2]

int vImageConvolver::Convolve ( FLTNB ap_outputImage)
privatevirtual

Reimplemented in iImageConvolverStationaryIsotropicGaussian, and iImageConvolverStationaryIsotropicGaussian.

Definition at line 314 of file code/src/image/vImageConvolver.cc.

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

◆ ConvolveTranspose() [1/2]

virtual int vImageConvolver::ConvolveTranspose ( FLTNB ap_outputImage)
privatevirtual

◆ ConvolveTranspose() [2/2]

int vImageConvolver::ConvolveTranspose ( FLTNB ap_outputImage)
privatevirtual

Definition at line 403 of file code/src/image/vImageConvolver.cc.

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

◆ CopyToPaddedImage() [1/2]

void vImageConvolver::CopyToPaddedImage ( FLTNB ap_inputImage)
protected

◆ CopyToPaddedImage() [2/2]

void vImageConvolver::CopyToPaddedImage ( FLTNB ap_inputImage)
protected

Definition at line 271 of file code/src/image/vImageConvolver.cc.

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

◆ Initialize() [1/2]

int vImageConvolver::Initialize ( )

◆ Initialize() [2/2]

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 101 of file code/src/image/vImageConvolver.cc.

Here is the call graph for this function:

◆ ReadConfigurationFile() [1/2]

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

◆ ReadConfigurationFile() [2/2]

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

◆ ReadOptionsList() [1/2]

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

◆ ReadOptionsList() [2/2]

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

◆ SetImageDimensionsAndQuantification() [1/2]

void vImageConvolver::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Definition at line 218 of file code/include/image/vImageConvolver.hh.

Here is the caller graph for this function:

◆ SetImageDimensionsAndQuantification() [2/2]

void vImageConvolver::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Definition at line 218 of file include/image/vImageConvolver.hh.

◆ SetVerbose() [1/2]

void vImageConvolver::SetVerbose ( int  a_verbose)
inline

Definition at line 211 of file code/include/image/vImageConvolver.hh.

Here is the caller graph for this function:

◆ SetVerbose() [2/2]

void vImageConvolver::SetVerbose ( int  a_verbose)
inline

Definition at line 211 of file include/image/vImageConvolver.hh.

◆ ShowHelp() [1/2]

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 iImageConvolverStationaryIsotropicGaussian, iImageConvolverTemplate, iImageConvolverStationaryIsotropicGaussian, iImageConvolverTemplate, iImageConvolverStationaryGaussian, and iImageConvolverStationaryGaussian.

Here is the caller graph for this function:

◆ ShowHelp() [2/2]

virtual void vImageConvolver::ShowHelp ( )
pure virtual

Member Data Documentation

◆ m2p_kernel

FLTNB ** vImageConvolver::m2p_kernel
protected

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

Definition at line 247 of file code/include/image/vImageConvolver.hh.

◆ m_checked

bool vImageConvolver::m_checked
protected

Boolean that says if the parameters were checked or not

Definition at line 229 of file code/include/image/vImageConvolver.hh.

◆ m_dimPadX

INTNB vImageConvolver::m_dimPadX
protected

The number of voxels of the padded image along X

Definition at line 237 of file code/include/image/vImageConvolver.hh.

◆ m_dimPadXY

INTNB vImageConvolver::m_dimPadXY
protected

The number of voxels of the padded image in a slice

Definition at line 240 of file code/include/image/vImageConvolver.hh.

◆ m_dimPadXYZ

INTNB vImageConvolver::m_dimPadXYZ
protected

The total number of voxels of the padded image

Definition at line 241 of file code/include/image/vImageConvolver.hh.

◆ m_dimPadY

INTNB vImageConvolver::m_dimPadY
protected

The number of voxels of the padded image along Y

Definition at line 238 of file code/include/image/vImageConvolver.hh.

◆ m_dimPadZ

INTNB vImageConvolver::m_dimPadZ
protected

The number of voxels of the padded image along Z

Definition at line 239 of file code/include/image/vImageConvolver.hh.

◆ m_initialized

bool vImageConvolver::m_initialized
protected

Boolean that says if the convolver was initialized or not

Definition at line 230 of file code/include/image/vImageConvolver.hh.

◆ m_nbKernels

INTNB vImageConvolver::m_nbKernels
protected

The number of kernels (1 if stationary, more otherwise

Definition at line 243 of file code/include/image/vImageConvolver.hh.

◆ m_offsetX

INTNB vImageConvolver::m_offsetX
protected

The offset of the padded image along X

Definition at line 234 of file code/include/image/vImageConvolver.hh.

◆ m_offsetY

INTNB vImageConvolver::m_offsetY
protected

The offset of the padded image along Y

Definition at line 235 of file code/include/image/vImageConvolver.hh.

◆ m_offsetZ

INTNB vImageConvolver::m_offsetZ
protected

The offset of the padded image along Z

Definition at line 236 of file code/include/image/vImageConvolver.hh.

◆ m_stationary

bool vImageConvolver::m_stationary
protected

Boolean that says if the kernel is stationary or not

Definition at line 231 of file code/include/image/vImageConvolver.hh.

◆ m_verbose

int vImageConvolver::m_verbose
protected

The verbose level

Definition at line 227 of file code/include/image/vImageConvolver.hh.

◆ mp_dimKernelX

INTNB * vImageConvolver::mp_dimKernelX
protected

The dimension of each kernel along X

Definition at line 244 of file code/include/image/vImageConvolver.hh.

◆ mp_dimKernelY

INTNB * vImageConvolver::mp_dimKernelY
protected

The dimension of each kernel along Y

Definition at line 245 of file code/include/image/vImageConvolver.hh.

◆ mp_dimKernelZ

INTNB * vImageConvolver::mp_dimKernelZ
protected

The dimension of each kernel along Z

Definition at line 246 of file code/include/image/vImageConvolver.hh.

◆ mp_ImageDimensionsAndQuantification

oImageDimensionsAndQuantification * vImageConvolver::mp_ImageDimensionsAndQuantification
protected

Pointer to the oImageDimensionsAndQuantification object in use

Definition at line 226 of file code/include/image/vImageConvolver.hh.

◆ mp_paddedImage

FLTNB * vImageConvolver::mp_paddedImage
protected

The actual padded buffer image

Definition at line 233 of file code/include/image/vImageConvolver.hh.


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