algorithm, based on watershed, allowing to separate binary 3d shapes
This algorithm, based on distance map and watershed algorithms, allows to separate shapes of an input binary 3d image.
Given an input binary image InBinImg3d, algorithm process following steps :
- Distance map computation (see Distance Map 3d) which allows to define area of influence for each shape.
- Dilation of local extrema on distance map (see Dilate Local Extrema 3d). This step can be customized using parameter InDilateFactor which allows to merge local maxima.
- Separation of shapes using watershed algorithm (see Seeded Watershed 3d). This step can be customized using parameters InOptWatershedProcMode and InOptNbMinDataByThread.
Global output of a algorithm can be customized using parameter InWatershedSeparationMode which can take following values :
- ipsdk::imaproc::attr::eWatershedSeparationMode::eWSM_Split (in this case OutBinLabImg is a binary image)
- ipsdk::imaproc::attr::eWatershedSeparationMode::eWSM_Lines (in this case OutBinLabImg is a binary image)
- ipsdk::imaproc::attr::eWatershedSeparationMode::eWSM_Basins (in this case OutBinLabImg is a label image)
Futher illustrations for this algorithm can be found looking its 2d version : Watershed Binary Separation 2d.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
import PyIPSDK.IPSDKIPLBinarization as bin
Code Example
inGreyImg3d = PyIPSDK.loadTiffImageFile(inputGreyImgPath,
PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
inBinImg3d = bin.thresholdImg(inGreyImg3d, 75, 255)
outImg = advmorpho.watershedBinarySeparation3dImg(inBinImg3d, 5,
PyIPSDK.eWatershedSeparationMode.eWSM_Split,
PyIPSDK.eWatershedProcessingMode.eWPM_Repeatable)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/WatershedBinarySeparation3dImg/WatershedBinarySeparation3dImg.h>
Code Example
eTiffDirectoryMode::eTDM_Volume);