53 cout <<
"This convolver is based on a classic stationary Gaussian kernel." << endl;
54 cout <<
"It can be anisotropic so that the transaxial and axial FWHM can be different." << endl;
55 cout <<
"One also have to choose the number of sigmas of the Gaussian distribution that will be included in the kernel." << endl;
56 cout <<
"The following options can be used (in this particular order when provided as a list, separated by commas):" << endl;
57 cout <<
" transaxial FWHM: to set the transaxial FWHM (in mm)" << endl;
58 cout <<
" axial FWHM: to set the axial FWHM (in mm)" << endl;
59 cout <<
" number of sigmas: to set the number of sigmas included in the kernel (recommendations: at least 3. and maximum 5.)" << endl;
71 key_word =
"transaxial FWHM";
74 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
78 key_word =
"axial FWHM";
81 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
85 key_word =
"number of sigmas";
88 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
105 if (
ReadStringOption(a_optionsList, options, 3,
",",
"Stationary Gaussian convolver configuration"))
107 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to correctly read the list of options !" << endl);
128 Cerr(
"***** iImageConvolverStationaryGaussian::CheckSpecificParameters() -> Number of sigmas included in the kernel must be strictly positive !" << endl);
134 Cerr(
"***** iImageConvolverStationaryGaussian::CheckSpecificParameters() -> Transaxial FWHM is negative !" << endl);
140 Cerr(
"***** iImageConvolverStationaryGaussian::CheckSpecificParameters() -> Axial FWHM is negative !" << endl);
157 Cout(
"iImageConvolverStationaryGaussian::BuildConvolutionKernel() -> Compute convolution kernel" << endl);
172 FLTNB two_sqrt_two_ln_two = 2.*sqrt(2.*log(2.));
178 INTNB half_kern_dimX = ((
INTNB)(half_kern_floatX));
179 if (half_kern_floatX-((
FLTNB)half_kern_dimX)>0.5) half_kern_dimX++;
180 INTNB half_kern_dimY = ((
INTNB)(half_kern_floatY));
181 if (half_kern_floatY-((
FLTNB)half_kern_dimY)>0.5) half_kern_dimY++;
182 INTNB half_kern_dimZ = ((
INTNB)(half_kern_floatZ));
183 if (half_kern_floatZ-((
FLTNB)half_kern_dimZ)>0.5) half_kern_dimZ++;
195 if (
m_verbose>=2)
Cout (
" --> Kernel dimensions: [" <<
mp_dimKernelX[0] <<
";" << mp_dimKernelY[0] <<
";" << mp_dimKernelZ[0] <<
"]" << endl);
212 FLTNB sum_kernel = 0.;
213 for (
int z=0, index=0; z<mp_dimKernelZ[0]; z++)
217 for (
int y=0; y<mp_dimKernelY[0]; y++)
Declaration of class oImageDimensionsAndQuantification.
FLTNB GetVoxSizeX()
Get the voxel's size along the X axis, in mm.
int BuildConvolutionKernel()
A private function used to build the convolution kernel specific to the child convolver.
FLTNB GetVoxSizeZ()
Get the voxel's size along the Z axis, in mm.
int ReadConfigurationFile(const string &a_fileOptions)
A function used to read options from a configuration file.
int CheckSpecificParameters()
A private function used to check the parameters settings specific to the child module.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
FLTNB GetVoxSizeY()
Get the voxel's size along the Y axis, in mm.
Declaration of class iImageConvolverStationaryGaussian.
int ReadDataASCIIFile(const string &a_file, const string &a_keyword, T *ap_return, int a_nbElts, bool a_mandatoryFlag)
Look for "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter a...
iImageConvolverStationaryGaussian()
The constructor of iImageConvolverStationaryGaussian.
#define KEYWORD_MANDATORY
int ReadOptionsList(const string &a_listOptions)
A function used to read options from a list of options.
Declaration of class oImageSpace.
~iImageConvolverStationaryGaussian()
The destructor of iImageConvolverStationaryGaussian.
Declaration of class vImageConvolver.
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &sep, const string &a_option)
Parse the 'a_input' string corresponding to the 'a_option' into 'a_nbElts' elements, using the 'sep' separator. The results are returned in the templated 'ap_return' dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.
void ShowHelp()
A function used to show help about the child module.
This abstract class is the generic image convolver class used by the oImageConvolverManager.