IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed. More...

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg (const image::ImageConstPtr &pInBinImg3d)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg (const image::ImageConstPtr &pInBinImg3d, const ipsdk::ipUInt32 nbMaxIter)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg_keepAll (const image::ImageConstPtr &pInBinImg3d)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg_keepAll (const image::ImageConstPtr &pInBinImg3d, const ipsdk::ipUInt32 nbMaxIter)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg (const image::ImageConstPtr &pInBinImg3d, const image::ImagePtr &pOutBinImg)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg (const image::ImageConstPtr &pInBinImg3d, const ipsdk::ipUInt32 nbMaxIter, const image::ImagePtr &pOutBinImg)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg_keepAll (const image::ImageConstPtr &pInBinImg3d, const image::ImagePtr &pOutBinImg)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg_keepAll (const image::ImageConstPtr &pInBinImg3d, const ipsdk::ipUInt32 nbMaxIter, const image::ImagePtr &pOutBinImg)
 wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed More...
 

Detailed Description

Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed.

This algorithm iteratively reduces the branches of skeletons in the 3d input binary image. For a single pass, voxels with a single neighbour are detected and are deleted. The algorithm repeats the process untill the output image does not change anymore.

However, it is possible to limit the number of iterations to keep parts of some branches by specifying the parameter nbMaxIter.

When the image contains skeletons without loop (i.e. the object that generated the skeleton does not have holes), the pruning operation completely remove the object. In order to keep a record of the presence of such objects, it is possible to call the function pruning3dImg_keepAll instead of the standard wrapper. This way, the result for a skeleton without loop is an isolated single voxel.

Please, see Pruning of 2d skeletons for an example of application of pruning on a 2D image.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InBinImg3d [Input] binary 3d image for processing operation X
ipsdk::imaproc::attr::InOptNbMaxIter [Input Optional] Maximum number of iterations (ignored if equals to 0) X
ipsdk::imaproc::attr::InRemoveSkeletonsWithoutHoles [Input] If the attribute equals true, the skeletons corresponding to objects without holes are completely removed. If the value is false, a single pixel remains for these objects X
ipsdk::imaproc::attr::OutBinImg [Output] binary image for processing operation ipsdk::imaproc::duplicateInOut (_pOutBinImg, _pInBinImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInBinImg3d,_pOutBinImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# boundary 2d image computation
outImg = morpho.pruning3dImg(inImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLBasicMorphology

Header file

Code Example

// compute pruning on input image
ImagePtr pOutImg = pruning3dImg(pInBinImg);
See also
Pruning3dImgLvl1
Pruning3dImgLvl2
Pruning3dImgLvl3

Function Documentation

◆ pruning3dImg() [1/4]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg ( const image::ImageConstPtr pInBinImg3d)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg() [2/4]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg ( const image::ImageConstPtr pInBinImg3d,
const ipsdk::ipUInt32  nbMaxIter 
)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg_keepAll() [1/4]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg_keepAll ( const image::ImageConstPtr pInBinImg3d)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg_keepAll() [2/4]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::pruning3dImg_keepAll ( const image::ImageConstPtr pInBinImg3d,
const ipsdk::ipUInt32  nbMaxIter 
)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg() [3/4]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg ( const image::ImageConstPtr pInBinImg3d,
const image::ImagePtr pOutBinImg 
)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg() [4/4]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg ( const image::ImageConstPtr pInBinImg3d,
const ipsdk::ipUInt32  nbMaxIter,
const image::ImagePtr pOutBinImg 
)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg_keepAll() [3/4]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg_keepAll ( const image::ImageConstPtr pInBinImg3d,
const image::ImagePtr pOutBinImg 
)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pruning3dImg_keepAll() [4/4]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::pruning3dImg_keepAll ( const image::ImageConstPtr pInBinImg3d,
const ipsdk::ipUInt32  nbMaxIter,
const image::ImagePtr pOutBinImg 
)

wrapper function for Reduces 3D skeleton branches. If enough iterations are processed, the branches are completely removed

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure