IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::gaussianSmoothing3dImg (const image::ImageConstPtr &pInImg3d, const ipReal32 inStdDev)
 wrapper function for Gaussian filter used to blur a 3d image More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::gaussianSmoothing3dImg (const image::ImageConstPtr &pInImg3d, const ipReal32 inStdDevX, const ipReal32 inStdDevY, const ipReal32 inStdDevZ, const attr::GaussianCoverageConstPtr &pInOptSmoothingGaussianCoverage)
 wrapper function for Gaussian filter used to blur a 3d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::gaussianSmoothing3dImg (const image::ImageConstPtr &pInImg3d, const ipReal32 inStdDevX, const ipReal32 inStdDevY, const ipReal32 inStdDevZ, const attr::GaussianCoverageConstPtr &pInOptSmoothingGaussianCoverage, const image::ImagePtr &pOutImg)
 wrapper function for Gaussian filter used to blur a 3d image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InStdDevX [Input] standard deviation used for operation along X axis X
ipsdk::imaproc::attr::InStdDevY [Input] standard deviation used for operation along Z axis X
ipsdk::imaproc::attr::InStdDevZ [Input] standard deviation used for operation along Z axis X
ipsdk::imaproc::attr::InOptSmoothingGaussianCoverage [Input Optional] Parameter allowing to specify a gaussian distribution coverage for processing X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d,_pOutImg)

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

Associated library

IPSDKIPLFiltering

Header file

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));
See also
GaussianSmoothing3dImgLvl1

Function Documentation

◆ gaussianSmoothing3dImg() [1/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::gaussianSmoothing3dImg ( const image::ImageConstPtr pInImg3d,
const ipReal32  inStdDev 
)

wrapper function for Gaussian filter used to blur a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ gaussianSmoothing3dImg() [2/3]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::gaussianSmoothing3dImg ( const image::ImageConstPtr pInImg3d,
const ipReal32  inStdDevX,
const ipReal32  inStdDevY,
const ipReal32  inStdDevZ,
const attr::GaussianCoverageConstPtr pInOptSmoothingGaussianCoverage 
)

wrapper function for Gaussian filter used to blur a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ gaussianSmoothing3dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::gaussianSmoothing3dImg ( const image::ImageConstPtr pInImg3d,
const ipReal32  inStdDevX,
const ipReal32  inStdDevY,
const ipReal32  inStdDevZ,
const attr::GaussianCoverageConstPtr pInOptSmoothingGaussianCoverage,
const image::ImagePtr pOutImg 
)

wrapper function for Gaussian filter used to blur a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure