97 Cerr(
"***** vImageConvolver::CheckParameters() -> The verbose level must be set positive !" << endl);
103 Cerr(
"***** vImageConvolver::CheckParameters() -> The image dimensions must be set through a oImageDimensionsAndQuantification !" << endl);
109 Cerr(
"***** vImageConvolver::CheckParameters() -> A problem occured while checking specific parameters of the child convolver !" << endl);
129 Cerr(
"***** vImageConvolver::Initialize() -> Parameters have not been checked ! Please call CheckParameters() before." << endl);
136 Cerr(
"***** vImageConvolver::Initialize() -> A problem occured while building the convolution kernel !" << endl);
147 Cerr(
"***** vImageConvolver::Initialize() -> The number of kernels is negative or null !" << endl);
153 Cerr(
"***** vImageConvolver::Initialize() -> The kernel dimensions are not allocated !" << endl);
159 Cerr(
"***** vImageConvolver::Initialize() -> The kernel is not allocated !" << endl);
166 INTNB max_kern_size_Z = 0;
167 INTNB max_kern_size_Y = 0;
168 INTNB max_kern_size_X = 0;
176 Cerr(
"***** vImageConvolver::Initialize() -> Dimension of " << k <<
"th convolution kernel along Z (" <<
mp_dimKernelZ[k] <<
" is not odd !" << endl);
182 Cerr(
"***** vImageConvolver::Initialize() -> Dimension of " << k <<
"th convolution kernel along Y (" <<
mp_dimKernelY[k] <<
" is not odd !" << endl);
188 Cerr(
"***** vImageConvolver::Initialize() -> Dimension of " << k <<
"th convolution kernel along X (" <<
mp_dimKernelX[k] <<
" is not odd !" << endl);
209 Cerr(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl);
210 Cerr(
"!!!!! vImageConvolver::Initialize() -> The maximum half size of the convolution kernels is higher or equal to the number of slices of the image." << endl);
211 Cerr(
"!!!!! This won't affect the results, but a convolution running time factor of " << over_computation_factor <<
" will be lost for nothing." << endl);
212 Cerr(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl);
245 Cerr(
"***** vImageConvolver::ApplyConvolution() -> Called while not initialized !" << endl);
255 Cerr(
"***** vImageConvolver::ApplyConvolution() -> A problem occured while actually convolving !" << endl);
272 Cerr(
"***** vImageConvolver::ApplyConvolutionTranspose() -> Called while not initialized !" << endl);
282 Cerr(
"***** vImageConvolver::ApplyConvolutionTranspose() -> A problem occured while actually convolving !" << endl);
299 Cerr(
"***** vImageConvolver::CopyToPaddedImage() -> Called while not initialized !" << endl);
306 #pragma omp parallel for private(z) schedule(guided)
326 ap_inputImage[coord_orig] = 0.;
342 Cerr(
"***** vImageConvolver::Convolve() -> Called while not initialized !" << endl);
356 INTNB stationary_kernel = 0;
359 #pragma omp parallel for private(z) schedule(guided)
365 FLTNB kernel_integral = 0.;
374 for (
INTNB xyk=0; xyk<
mp_dimKernelX[stationary_kernel]*mp_dimKernelY[stationary_kernel]; xyk++)
375 kernel_integral +=
m2p_kernel[stationary_kernel][kernZ_base+xyk];
386 INTNB index_img = indexZY_base + x;
388 for (
INTNB zk=0, index_kern=0; zk<mp_dimKernelZ[stationary_kernel]; zk++)
399 INTNB index_pad = indexZY_pad + x + xk;
401 ap_outputImage[index_img] +=
mp_paddedImage[index_pad] *
m2p_kernel[stationary_kernel][index_kern] / kernel_integral;
414 Cerr(
"***** vImageConvolver::Convolve() -> To use a non-stationary kernel, you should overload this function to implement your own in your child convolver !" << endl);
429 Cerr(
"***** vImageConvolver::ConvolveTranspose() -> Called while not initialized !" << endl);
443 Cerr(
"***** vImageConvolver::ConvolveTranspose() -> To use a non-stationary kernel, you should overload this function to implement your own in your child convolver !" << endl);
Declaration of class oImageDimensionsAndQuantification.
virtual int ConvolveTranspose(FLTNB *ap_outputImage)
A private function used to apply the transpose convolution on the padded image to the provided output...
int Initialize()
A public function used to initialize the module.
virtual int BuildConvolutionKernel()=0
A private function used to build the convolution kernel specific to the child convolver.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
int CheckParameters()
A public function used to check the parameters settings.
INTNB GetNbVoxXY()
Get the number of voxels in a slice.
int ApplyConvolutionTranspose(FLTNB *ap_image)
A public function used to apply the transpose convolution module on the provided image.
virtual ~vImageConvolver()
The destructor of vImageConvolver.
vImageConvolver()
The constructor of vImageConvolver.
int ApplyConvolution(FLTNB *ap_image)
A public function used to apply the convolution module on the provided image.
Declaration of class oImageSpace.
virtual int CheckSpecificParameters()=0
A private function used to check the parameters settings specific to the child convolver.
virtual int Convolve(FLTNB *ap_outputImage)
A private function used to apply the convolution on the padded image to the provided output image...
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
Declaration of class vImageConvolver.
void CopyToPaddedImage(FLTNB *ap_inputImage)
A private function used to copy the provided image into the padded buffer.
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.