CASToR
2.0
Tomographic Reconstruction (PET/SPECT/CT)
|
This abstract class is the generic image convolver class used by the oImageConvolverManager. More...
#include <vImageConvolver.hh>
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 | |
oImageDimensionsAndQuantification * | mp_ImageDimensionsAndQuantification |
int | m_verbose |
bool | m_checked |
bool | m_initialized |
bool | m_stationary |
FLTNB * | mp_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 |
INTNB * | mp_dimKernelX |
INTNB * | mp_dimKernelY |
INTNB * | mp_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... | |
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.
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.
|
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.
int vImageConvolver::ApplyConvolution | ( | FLTNB * | ap_image | ) |
A public function used to apply the convolution module on the provided image.
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.
Definition at line 240 of file vImageConvolver.cc.
int vImageConvolver::ApplyConvolutionTranspose | ( | FLTNB * | ap_image | ) |
A public function used to apply the transpose convolution module on the provided image.
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.
Definition at line 267 of file vImageConvolver.cc.
|
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.
Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.
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.
Definition at line 92 of file vImageConvolver.cc.
|
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.
Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.
|
privatevirtual |
A private function used to apply the convolution on the padded image to the provided output image.
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.
Definition at line 337 of file vImageConvolver.cc.
|
privatevirtual |
A private function used to apply the transpose convolution on the padded image to the provided output image.
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.
Definition at line 424 of file vImageConvolver.cc.
|
private |
A private function used to copy the provided image into the padded buffer.
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.
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.
Definition at line 124 of file vImageConvolver.cc.
|
pure virtual |
A function used to read options from a configuration file.
const | string& 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.
Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.
|
pure virtual |
A function used to read options from a list of options.
const | string& 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.
Implemented in iImageConvolverTemplate, and iImageConvolverStationaryGaussian.
|
inline |
Set the member mp_ImageDimensionsAndQuantification to the provided value.
oImageDimensionsAndQuantification* | ap_ImageDimensionsAndQuantification |
Definition at line 240 of file vImageConvolver.hh.
|
inline |
Set the member m_verboseLevel to the provided value.
int | a_verboseLevel |
Definition at line 233 of file vImageConvolver.hh.
|
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.
|
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.
|
protected |
Boolean that says if the parameters were checked or not
Definition at line 251 of file vImageConvolver.hh.
|
protected |
The number of voxels of the padded image along X
Definition at line 259 of file vImageConvolver.hh.
|
protected |
The number of voxels of the padded image in a slice
Definition at line 262 of file vImageConvolver.hh.
|
protected |
The total number of voxels of the padded image
Definition at line 263 of file vImageConvolver.hh.
|
protected |
The number of voxels of the padded image along Y
Definition at line 260 of file vImageConvolver.hh.
|
protected |
The number of voxels of the padded image along Z
Definition at line 261 of file vImageConvolver.hh.
|
protected |
Boolean that says if the convolver was initialized or not
Definition at line 252 of file vImageConvolver.hh.
|
protected |
The number of kernels (1 if stationary, more otherwise
Definition at line 265 of file vImageConvolver.hh.
|
protected |
The offset of the padded image along X
Definition at line 256 of file vImageConvolver.hh.
|
protected |
The offset of the padded image along Y
Definition at line 257 of file vImageConvolver.hh.
|
protected |
The offset of the padded image along Z
Definition at line 258 of file vImageConvolver.hh.
|
protected |
Boolean that says if the kernel is stationary or not
Definition at line 253 of file vImageConvolver.hh.
|
protected |
The verbose level
Definition at line 249 of file vImageConvolver.hh.
|
protected |
The dimension of each kernel along X
Definition at line 266 of file vImageConvolver.hh.
|
protected |
The dimension of each kernel along Y
Definition at line 267 of file vImageConvolver.hh.
|
protected |
The dimension of each kernel along Z
Definition at line 268 of file vImageConvolver.hh.
|
protected |
Pointer to the oImageDimensionsAndQuantification object in use
Definition at line 248 of file vImageConvolver.hh.
|
protected |
The actual padded buffer image
Definition at line 255 of file vImageConvolver.hh.