66 cout <<
"This convolver is based on a classic stationary Gaussian kernel." << endl;
67 cout <<
"It can be anisotropic so that the transaxial and axial FWHM can be different." << endl;
68 cout <<
"One also have to choose the number of sigmas of the Gaussian distribution that will be included in the kernel." << endl;
69 cout <<
"The following options can be used (in this particular order when provided as a list, separated by commas):" << endl;
70 cout <<
" transaxial FWHM: to set the transaxial FWHM (in mm)" << endl;
71 cout <<
" axial FWHM: to set the axial FWHM (in mm)" << endl;
72 cout <<
" number of sigmas: to set the number of sigmas included in the kernel (recommendations: at least 3. and maximum 5.)" << endl;
84 key_word =
"transaxial FWHM";
87 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
91 key_word =
"axial FWHM";
94 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
98 key_word =
"number of sigmas";
101 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
118 if (
ReadStringOption(a_optionsList, options, 3,
",",
"Stationary Gaussian convolver configuration"))
120 Cerr(
"***** iImageConvolverStationaryGaussian::ReadConfigurationFile() -> Failed to correctly read the list of options !" << endl);
141 Cerr(
"***** iImageConvolverStationaryGaussian::CheckSpecificParameters() -> Number of sigmas included in the kernel must be strictly positive !" << endl);
147 Cerr(
"***** iImageConvolverStationaryGaussian::CheckSpecificParameters() -> Transaxial FWHM is negative !" << endl);
153 Cerr(
"***** iImageConvolverStationaryGaussian::CheckSpecificParameters() -> Axial FWHM is negative !" << endl);
170 Cout(
"iImageConvolverStationaryGaussian::BuildConvolutionKernel() -> Compute convolution kernel" << endl);
185 FLTNB two_sqrt_two_ln_two = 2.*sqrt(2.*log(2.));
191 INTNB half_kern_dimX = ((
INTNB)(half_kern_floatX));
192 if (half_kern_floatX-((
FLTNB)half_kern_dimX)>0.5) half_kern_dimX++;
193 INTNB half_kern_dimY = ((
INTNB)(half_kern_floatY));
194 if (half_kern_floatY-((
FLTNB)half_kern_dimY)>0.5) half_kern_dimY++;
195 INTNB half_kern_dimZ = ((
INTNB)(half_kern_floatZ));
196 if (half_kern_floatZ-((
FLTNB)half_kern_dimZ)>0.5) half_kern_dimZ++;
208 if (
m_verbose>=2)
Cout (
" --> Kernel dimensions: [" <<
mp_dimKernelX[0] <<
";" << mp_dimKernelY[0] <<
";" << mp_dimKernelZ[0] <<
"]" << endl);
225 FLTNB sum_kernel = 0.;
226 for (
int z=0, index=0; z<mp_dimKernelZ[0]; z++)
230 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.