i3dlib

Documentation

i3d::AOSCLMCFilter< VOXELIN, VOXELOUT > Class Template Reference
[Image preprocessing filters]

This class implements the nonlinear diffusion filter, which was published by Catte, Lions, Morel and Coll. As the other nonlinear filters, this filter smooths the image in the relatively continuos region and do not smooth the significante edges. In the typical output image is suppresed the noise and the edges remain sharp and well localised. The diffused image is the solution of the equation $ u_t = \mathrm{div} (g(|\nabla u_{\sigma}|^2) \nabla u)$. More...

#include <LevelSet.h>

Inheritance diagram for i3d::AOSCLMCFilter< VOXELIN, VOXELOUT >:

i3d::ImplicitAOSScheme< VOXELIN, VOXELOUT > i3d::PDESolver< VOXELIN, VOXELOUT > List of all members.

Public Member Functions

void SetConductance (VOXELOUT c)
 Set the conductance coefficient lambda.
VOXELOUT GetConductance ()
 Get the value of the conductance lambda coefficient.
void SetSigma (VOXELOUT sig)
 Set the sigma, standard deviation of the gaussian filter.
VOXELOUT GetSigma ()
 Get the sigma, standard deviation of the gaussian filter.
void SetExponent (VOXELOUT exp)
 Set the value of the m exponent.
VOXELOUT GetExponent ()
 Get the value of the m exponent.
virtual void ComputeDiffusivity ()
 computes the $g(s^2)$ function for the whole image.
virtual void SetSpacing (float x, float y, float z)
 Set the spatial spacing. Typical values are (1.0,1.0,1.0*z).
virtual void SetSpacing (Vector3d< float > vec)
 Set the spatial spacing. Typical values are (1.0,1.0,1.0*z).

Protected Attributes

VOXELOUT Conductance
 The conductance parameter of the diffusion function.
VOXELOUT Exponent
 The Exponent parameter of the diffusion function.
LODGaussianBlur< VOXELOUT,
VOXELOUT > * 
GaussEstimator
 Pointer to the LODGaussianBlur instance. This object performs the gaussian blur of the input image, before computing the gradient.

Detailed Description

template<class VOXELIN, class VOXELOUT>
class i3d::AOSCLMCFilter< VOXELIN, VOXELOUT >

This class implements the nonlinear diffusion filter, which was published by Catte, Lions, Morel and Coll. As the other nonlinear filters, this filter smooths the image in the relatively continuos region and do not smooth the significante edges. In the typical output image is suppresed the noise and the edges remain sharp and well localised. The diffused image is the solution of the equation $ u_t = \mathrm{div} (g(|\nabla u_{\sigma}|^2) \nabla u)$.

The CLMC filter is improved version of the classic filter of Perona and Malik (see AOSPMFilter class). The image is smoothed by finding solution of equation

\[ u_t = \mathrm{div} (g(|\nabla u_{\sigma}|^2) \nabla u) \]

where $ u_{\sigma}$ denotes the image convolved with gaussian of standard deviation $\sigma$, $ g(s^2) $ is decreasing function of the smoothed image gradient, and $ u_0$ is the input image (boundary condition of the PDE). The idea of this equation is to smooth the image in regions with almost no gradient and do not diffuse the image near significant edges. The strength of the diffusion is controled by the diffusivity function g. This class completely inherits the AOS numerical scheme from class ImplicitAOSScheme. It only reimplements the ComputeDiffusivity() function, which first convolves the inpute image with the Gaussian of standard deviation $\sigma$ (see documentation of LODGaussianBlur) and then computes g diffusivity function for all voxels in the image $u^n$.

\[ g(s^2) = 1 - \mathrm{exp}\left(\frac{-Cm}{(s^2/ \lambda^2)^m}\right ) \]

For the meaning of the parameters see documentation of the AOSCLMCFilter class.

The diffusivity g function is computed by:

\[ g(s^2) = 1 - \mathrm{exp}\left(\frac{-Cm}{(s^2/ \lambda^2)^m}\right ) \]

The only free variable in this expression is the $s^2$, which is the squared gradint magnitude. The coefficients conductance $\lambda$ and exponent m are selected by the user. The size of conductance lambda directly influences the smoothing. On can say, that the voxel will be smoothed, if the gradient magnitude in it is less or equal than $\lambda$ and on the contrary not smoothed if the gradient magnitude in the voxel is greater than $\lambda$ parameter. The size of m influences the steepness of the cross-over between "smoothing" and "not smoothing". The coefficient Cm is computed automatically. For having the idea of what is the diffusivity function exactly doing see following picture.

diffusivity.gif

Diffusivity g function: lambda = 10.0, m = 4.0, Cm = 4.22977

The typical setting of coefficients of g function for biomedical images produced in LOM should be:
$\lambda$ between 1 and 10, m between 2 and 16.
The $\sigma$ should be at least 1.0 to suppress noise.
A few of iterations (1 to 10) should be sufficient to to smooth the image. The meaningful time step should be between 0.1 and 5.0 (See also the example code). The numerical scheme which finds the solution of the equation is implemented in ImplicitAOSScheme class. This class inherits the solution.

The implementation of this class is based on the articles
Joachim Weickert, Bart M. ter Haar Romeny, Max A. Viergever, Efficient and Reliable Schemes for Nonlinear Diffusion Filtering , IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 6, NO. 3, PP. 398-410, MARCH 1998.
Francine Catte, Piere-Louis Lions, Jean-Michel Morel and Tomeu Coll,Image Selective Smoothing and Edge Detection by nonlinear diffusion, SIAM Journal of Numer. Anal., Vol. 29, 182 - 193, 1992.

The example code uses the AOS implementation of CLMC diffusion filter.

   .....
   
   Image3d<GRAY8> i;
   Image3d<float> fimg;
   i.ReadImage('input.tif'); // read input image
   AOSCLMCFilter<GRAY8,float> CLMC(i,fimg); // instantiate  the filter  (the two parameters are the input and the output image)
   CLMC.SetMaximumNumberOfIterations(3); // Set the number of iterations to 2
   CLMC.SetSpacing(1.0,1.0,2.0); // Set the spacing of spatial discretisation to 1,1,2
   CLMC.SetSigma(1.0); // Set the sigma of the gaussian blur to 1.0
   CLMC.SetConductance(3.0); // Set the conductance parameter to 3.0
   CLMC.SetGlobalTimeStep(5.0); // Set the global time step
   CLMC.Execute(); // Perform the work of the filter
   FloatToGray8NoWeight(fimg,i); //Convert the output float image to gray8 image
   i.SaveImage('output.tif'); // save the output of the filter

   ......
  
Author:
Jan Hubený xhubeny@fi.muni.cz
Date:
2005


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