IPSDK 4.1.0.2
IPSDK : Image Processing Software Development Kit
Gaussian Smoothing 3d
imagegaussianSmoothing3dImg (inImg3d,inStdDev)
imagegaussianSmoothing3dImg (inImg3d,inStdDevX,inStdDevY,inStdDevZ,inOptSmoothingGaussianCoverage)

Detailed Description

Smooth an input image convolving it with a 3d Gaussian kernel.

Used Gaussian kernel $GaussKnl_{XYZ}$ coefficients are defined as follow :

\[ GaussKnl_{XYZ}[o_x, o_y, o_z] = \dfrac{1}{(2\pi)^\frac{3}{2}\sigma_x\sigma_y\sigma_z}e^{-\dfrac{1}{2}\left(\dfrac{o_x^2}{\sigma_x^2}+\dfrac{o_y^2}{\sigma_y^2}+\dfrac{o_z^2}{\sigma_z^2}\right)} \]

where :

Size $[n_x, n_y, n_z]$ of this finite kernel is controlled by InOptGradientGaussianCoverage attribute.
This parameter defined the minimum distribution spread ratio which should be reach regards to an infinite Gaussian distribution.
We define for example $n_x$ such that :

\[ n_x = \max(MinHalfKernelSize, \min(\{n\}\in \mathbb{N}^+) / \sum_{o_x=-\dfrac{n_x}{2}}^{\dfrac{n_x}{2}}{GaussKnl_X[o_x]}>= GaussianRatio \times \sum_{o_x=-\infty}^{+\infty}{GaussKnl_X[o_x]}) \]

where :

\[ GaussKnl_X[o_x] = \dfrac{1}{\sqrt{2\pi}\sigma_x}e^{-\dfrac{o_x^2}{2\sigma_x^2}} \]

On output image values are given by:

\[ OutImg[x, y, z] = \sum_{o_z=-\dfrac{n_z}{2}}^{\dfrac{n_z}{2}}{\sum_{o_y=-\dfrac{n_y}{2}}^{\dfrac{n_y}{2}}{\sum_{o_x=-\dfrac{n_x}{2}}^{\dfrac{n_x}{2}}{InImg3d[x+o_x, y+o_y, z+o_z] \times GaussKnl_{XYZ}[o_x, o_y, o_z]}}} \]

Input and output images must have same size.

Here is an example of a Gaussian smoothing operation applied to an 8-bits grey levels input image (with $InStdDevX=InStdDevY=InStdDevZ=1$):

gaussianSmoothing3d.png
See also
http://en.wikipedia.org/wiki/Gaussian_filter
http://en.wikipedia.org/wiki/Gaussian_blur

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# gaussian smoothing filter 3d computation
outImg = filter.gaussianSmoothing3dImg(inImg, 1.5)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLFiltering/Processor/GaussianSmoothing3dImg/GaussianSmoothing3dImg.h>

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// compute gaussian smoothing on input image
ImagePtr pOutImg = gaussianSmoothing3dImg(pInImg, inStdDevX, inStdDevY, inStdDevZ, createGaussianCoverage(inOptGaussianRatio, minHalfKernelSize));