IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Gaussian filter used to compute Hessian on a 3d image. More...

IPSDKIPLFILTERING_API HessianXYZImg ipsdk::imaproc::filter::gaussianHessian3dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev)
 wrapper function for Gaussian filter used to compute Hessian on a 3d image More...
 
IPSDKIPLFILTERING_API HessianXYZImg ipsdk::imaproc::filter::gaussianHessian3dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDevX, const ipReal32 inStdDevY, const ipReal32 inStdDevZ, const attr::GaussianCoverageConstPtr &pInOptHessianGaussianCoverage)
 wrapper function for Gaussian filter used to compute Hessian on a 3d image More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::gaussianHessian3dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDevX, const ipReal32 inStdDevY, const ipReal32 inStdDevZ, const attr::GaussianCoverageConstPtr &pInOptHessianGaussianCoverage, const image::ImagePtr &pOutHxxImg, const image::ImagePtr &pOutHxyImg, const image::ImagePtr &pOutHxzImg, const image::ImagePtr &pOutHyyImg, const image::ImagePtr &pOutHyzImg, const image::ImagePtr &pOutHzzImg)
 wrapper function for Gaussian filter used to compute Hessian on a 3d image More...
 

Detailed Description

Gaussian filter used to compute Hessian on a 3d image.

The GaussianHessian3dImg algorithm uses separable Gaussian derivarive and smoothing filters to compute the Hessian matrix coefficient on each voxels.

Let's consider the three 1d filters $G(x, \sigma)$, $G_{\gamma}(x, \sigma)$ and $G_{\gamma \gamma}(x, \sigma)$ along the direction $ \gamma \in \left\{ x, y \right\} $:

\begin{eqnarray*} G(x, \sigma) & = & \frac{1}{\sigma \sqrt{2 \pi}} \exp \left( - \frac{x^2}{2 \sigma^2} \right)\\ G_{\gamma}(x, \sigma) & = & -\frac{x}{\sigma^3 \sqrt{2 \pi}} \exp \left( - \frac{x^2}{2 \sigma^2} \right)\\ G_{\gamma \gamma}(x, \sigma) & = & \frac{x^2-\sigma^2}{\sigma^5 \sqrt{2 \pi}} \exp \left( - \frac{x^2}{2 \sigma^2} \right) \end{eqnarray*}

$G(x, \sigma)$ is a smoothing function , $G_{\gamma}(x, \sigma)$ is the first order gaussian derivative and $G_{\gamma \gamma}(x, \sigma)$ is the second order Gaussian derivative along the directon $\gamma$, $ \gamma \in \left\{ x, y \right\} $.

The kernels used for these filters have a size of $3\sigma$. The Hessian coefficients are caultulated by a combination of these kernels:

\begin{eqnarray*} OutHxxImg(x, y, z) & = & \left( \left( InImg(x, y, z) * G_{XX}(x, \sigma) \right) * G(y, \sigma) \right) * G(z, \sigma)\\ OutHxyImg(x, y, z) & = & \left( \left( InImg(x, y, z) * G_{X}(x, \sigma) \right) * G_{Y}(y, \sigma) \right) * G(z, \sigma)\\ OutHxzImg(x, y, z) & = & \left( \left( InImg(x, y, z) * G_{X}(x, \sigma) \right) * G_{Z}(z, \sigma) \right) * G(y, \sigma)\\ OutHyyImg(x, y, z) & = & \left( \left( InImg(x, y, z) * G_{YY}(y, \sigma) \right) * G(x, \sigma) \right) * G(z, \sigma)\\ OutHyzImg(x, y, z) & = & \left( \left( InImg(x, y, z) * G_{Y}(y, \sigma) \right) * G_{Z}(z, \sigma) \right) * G(x, \sigma)\\ OutHzzImg(x, y, z) & = & \left( \left( InImg(x, y, z) * G_{ZZ}(z, \sigma) \right) * G(x, \sigma) \right) * G(y, \sigma) \end{eqnarray*}

See Gaussian Hessian 2d for an illustration of a 2d Gaussian Hessian result.

See also
https://en.wikipedia.org/wiki/Hessian_matrix

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::InOptHessianGaussianCoverage [Input Optional] Parameter allowing to specify a gaussian distribution coverage for processing X
ipsdk::imaproc::attr::OutHxxImg [Output] image of hessian (x-x axis) promoteUnary (_pOutHxxImg, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutHxyImg [Output] image of image of hessian (x-y axis) promoteUnary (_pOutHxyImg, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutHxzImg [Output] image of hessian (x-z axis) promoteUnary (_pOutHxzImg, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutHyyImg [Output] image of hessian (y-y axis) promoteUnary (_pOutHyyImg, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutHyzImg [Output] image of image of hessian (y-z axis) promoteUnary (_pOutHyzImg, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)
ipsdk::imaproc::attr::OutHzzImg [Output] image of image of hessian (z-z axis) promoteUnary (_pOutHzzImg, _pInImg3d, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d,_pOutHxxImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutHxxImg,_pOutHxyImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutHxxImg,_pOutHxzImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutHxxImg,_pOutHyyImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutHxxImg,_pOutHyzImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutHxxImg,_pOutHzzImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# gaussian gradient filter 2d computation
outHxxImg, outHxyImg, outHxzImg, outHyyImg, outHyzImg, outHzzImg = filter.gaussianHessian3dImg(inImg, 1.5)

Example of C++ code :

Example informations

Associated library

IPSDKIPLFiltering

Header file

Code Example

// opening input image
ImagePtr pInImg3d = loadTiffImageFile(inputImgPath, eTiffDirectoryMode::eTDM_Volume);
// compute gaussian gradient on input image
HessianXYZImg hessianXYZ = gaussianHessian3dImg(pInImg3d, inStdDev, inStdDev, inStdDev, createGaussianCoverage(inOptGaussianRatio, minHalfKernelSize));
See also
GaussianHessian3dImgLvl1

Function Documentation

◆ gaussianHessian3dImg() [1/3]

IPSDKIPLFILTERING_API HessianXYZImg ipsdk::imaproc::filter::gaussianHessian3dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev 
)

wrapper function for Gaussian filter used to compute Hessian on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ gaussianHessian3dImg() [2/3]

IPSDKIPLFILTERING_API HessianXYZImg ipsdk::imaproc::filter::gaussianHessian3dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDevX,
const ipReal32  inStdDevY,
const ipReal32  inStdDevZ,
const attr::GaussianCoverageConstPtr pInOptHessianGaussianCoverage 
)

wrapper function for Gaussian filter used to compute Hessian on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ gaussianHessian3dImg() [3/3]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::gaussianHessian3dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDevX,
const ipReal32  inStdDevY,
const ipReal32  inStdDevZ,
const attr::GaussianCoverageConstPtr pInOptHessianGaussianCoverage,
const image::ImagePtr pOutHxxImg,
const image::ImagePtr pOutHxyImg,
const image::ImagePtr pOutHxzImg,
const image::ImagePtr pOutHyyImg,
const image::ImagePtr pOutHyzImg,
const image::ImagePtr pOutHzzImg 
)

wrapper function for Gaussian filter used to compute Hessian on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure