IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

gradient computation on a 3d image using morphological operations More...

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::morphoGradient3dImg (const image::ImageConstPtr &pInImg3d, const StructuringElementXYZInfoConstPtr &pInSEXYZ)
 wrapper function for gradient computation on a 3d image using morphological operations More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::morphoGradient3dImg (const image::ImageConstPtr &pInImg3d, const StructuringElementXYZInfoConstPtr &pInSEXYZ, const image::ImagePtr &pOutImg)
 wrapper function for gradient computation on a 3d image using morphological operations More...
 

Detailed Description

gradient computation on a 3d image using morphological operations

A morphological gradient is the difference between the dilation and the erosion of a given image. It is a fast way to compute the gradient of an image. Output image pixel values, given a structuring element $ InSEXYZ $, are given by the following formula :

\[ OutImg = G(InImg3d)_{InSEXYZ} = InImg3d \oplus InSEXYZ - InImg3d \ominus InSEXYZ \]

Note
Behavior of this algorithm is specialized using specific morphological structuring elements (see 3d structuring elements for more informations about these shapes).
Please refer to Usage for examples of usage of different types of specific structuring elements during morphological operations.

An example of morphological gradient operation is illustrated in 2d case : see Morphological Gradient 2d.

See also
http://en.wikipedia.org/wiki/Morphological_gradient
Note
This algorithm is associated with two temporary working images ipsdk::imaproc::attr::OutOptWk1Img and ipsdk::imaproc::attr::OutWk1Img.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InSEXYZ [Input] structuring element xyz for processing operation X
ipsdk::imaproc::attr::OutOptWk1Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutWk1Img [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1Img, _pInImg3d)
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg3d)

Global Rule description

Global rule description for algorithm :
((ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutImg)) && 
 (ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutWk1Img)) && 
 (ipsdk::imaproc::noInSitu (_pInImg3d,_pOutImg)) && 
 (ipsdk::imaproc::noInSitu (_pInImg3d,_pOutWk1Img)) && 
 (ipsdk::processor::ifIsSet (
   _pOutOptWk1Img, (
    ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutOptWk1Img)) && 
   (ipsdk::imaproc::noInSitu (_pInImg3d,_pOutOptWk1Img)))))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# definition of used structuring element
inSE = PyIPSDK.sphericalSEXYZInfo(2)
# morphological gradient 3d image computation
outImg = morpho.morphoGradient3dImg(inImg, inSE)

Example of C++ code :

Example informations

Associated library

IPSDKIPLBasicMorphology

Header file

Code Example

// create a 2x3x4 rectangular structuring element
// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// compute morphological gradient on input image
ImagePtr pOutImg = morphoGradient3dImg(pInImg, pInSEXYZ);
See also
MorphoGradient3dImgLvl1

Function Documentation

◆ morphoGradient3dImg() [1/2]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::morphoGradient3dImg ( const image::ImageConstPtr pInImg3d,
const StructuringElementXYZInfoConstPtr pInSEXYZ 
)

wrapper function for gradient computation on a 3d image using morphological operations

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ morphoGradient3dImg() [2/2]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::morphoGradient3dImg ( const image::ImageConstPtr pInImg3d,
const StructuringElementXYZInfoConstPtr pInSEXYZ,
const image::ImagePtr pOutImg 
)

wrapper function for gradient computation on a 3d image using morphological operations

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure