IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Keep big shape 3dSee full documentation
imagekeepBigShape3dImg (inBinLabImg3d,inNbFeatures)

Detailed Description

keep only the big connected components in binary or label 3d image

This algorithm allows to remove the smallest connected components into a binary or label 3d input image, keeping only the inNbFeatures biggest features.

The output result image OutImg has same type as input image InBinLabImg3d. This means that an input binary image will produce an output binary image and that an input label image will produce an output label image. Note that in label case, input labels index are reordered to fill index list holes created by shape filtering . Moreover, the biggest the feature will be assigned to the lowest label and the smallest selected feature will be assigned to the highest label.

Here is an example of small connected component removal on an image 3d :

keepBigShape3dImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input image
inBinImg = PyIPSDK.loadTiffImageFile(inputImgPath, PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
# compute the selection on a binary image
# note: algorithm can also be used with input label image
outBinImg = advmorpho.keepBigShape3dImg(inBinImg, 3)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/KeepBigShape3dImg/KeepBigShape3dImg.h>

Code Example

// opening input image
ImagePtr pInBinImg = loadTiffImageFile(inputImgPath);
// compute the selection on a binary image
// note: algorithm can also be used with input label image
ImagePtr pOutImg = keepBigShape3dImg(pInBinImg, 3);