algorithm, based on watershed, allowing to separate grey 3d shapes
This algorithm, based on watershed algorithm, allows to separate shapes of an input 3d grey image. It is an equivalent of Watershed Binary Separation 3d applied on grey scale images case.
Given an input grey image InIntImg3d, algorithm process following steps :
- Dilation of local extrema on input image (see Dilate Local Extrema 3d). This step can be customized using parameter InDilateFactor which allows to merge local extrema and parameter InShapeGreyscaleType which allows to search for light or dark shapes (see below).
- Separation of shapes using watershed algorithm (see Seeded Watershed 3d). This step can be customized using parameters InOptWatershedProcMode and InOptNbMinDataByThread.
Parameter InShapeGreyscaleType allows to select for searched shapes type :
- for light shapes this parameters should take ipsdk::imaproc::attr::eShapeGreyscaleType::eSGT_Light value
- for dark shapes this parameters should take ipsdk::imaproc::attr::eShapeGreyscaleType::eSGT_Dark value
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 OutImg has same type as InIntImg). Used split value is equal to minimum or maximum supported value for image, depending on InShapeGreyscaleType value (minimal value for light shapes search and maximal value for dark shapes search).
- ipsdk::imaproc::attr::eWatershedSeparationMode::eWSM_Lines (in this case OutImg is a binary image)
- ipsdk::imaproc::attr::eWatershedSeparationMode::eWSM_Basins (in this case OutImg is a label image)
Futher illustrations for this algorithm can be found looking its 2d version : Watershed Grey Separation 2d.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
Code Example
inGreyImg3d = PyIPSDK.loadTiffImageFile(inputGreyImgPath,
PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
outImg = advmorpho.watershedGreySeparation3dImg(inGreyImg3d, PyIPSDK.eShapeGreyscaleType.eSGT_Light, 50,
PyIPSDK.eWatershedSeparationMode.eWSM_Split, PyIPSDK.eWPM_Repeatable)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/WatershedGreySeparation3dImg/WatershedGreySeparation3dImg.h>
Code Example
ImagePtr pInGreyImg3d =
loadTiffImageFile(utImagesCommonPath /
"blobs3d_483x348x31_UInt8.tif",
eTiffDirectoryMode::eTDM_Volume);