IPSDK 4.1.0.2
IPSDK : Image Processing Software Development Kit
Sobel Gradient 3d
xGradImg,yGradImg,zGradImgsobelGradient3dImg (inImg)
xGradImg,yGradImg,zGradImgsobelGradient3dImg (inImg,kernelType,bNormalize)
imagesobelXGradient3dImg (inImg)
imagesobelXGradient3dImg (inImg,kernelType,bNormalize)
imagesobelYGradient3dImg (inImg)
imagesobelYGradient3dImg (inImg,kernelType,bNormalize)
imagesobelZGradient3dImg (inImg)
imagesobelZGradient3dImg (inImg,kernelType,bNormalize)

Detailed Description

Compute X, Y and Z gradients of an input image convolving it with 3d Sobel kernels.

3d Sobel kernels are separable, they can be decomposed as the product of 3 vectors. X gradient kernel equals to the product $V_{smoothing}*V_{smoothing}*V_{deriv}$, Y gradient kernel equals to the product $V_{smoothing}*V_{deriv}*V_{smoothing}$, and Z gradient kernel equals to the product $V_{deriv}*V_{smoothing}*V_{smoothing}$. Depending on the value of parameter $InOptSobelKernelType$ (default value: eSKT_SobelHalfKnlSz1), smoothing and derivative vectors equal to:

To handle image borders, a mirror extrapolation is used (see Border policy for more details).

Here is an example of a Sobel gradient applied to an 8-bits grey levels input image with default parameters used:

sobelGradient3d.png
See also
https://en.wikipedia.org/wiki/Sobel_operator

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# Sobel gradient filter 3d computation
outGxImg, outGyImg, outGzImg = filter.sobelGradient3dImg(inImg)

Example of C++ code :

Example informations

Header file

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

Code Example

// opening input 3D image from TIFF file
ImagePtr pInImg = loadTiffImageFile(inputImgPath, eTiffDirectoryMode::eTDM_Volume);
// applying Sobel gradient to input image
GradientXYZImg gradientXYZ = sobelGradient3dImg(pInImg);