IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Adaptive binary watershed 3d algorithm. More...

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::adaptiveBinaryWatershed3dImg (const image::ImageConstPtr &pInBinImg3d, const ipReal64 inArithmeticVal, const ipsdk::imaproc::attr::eWatershedSeparationMode &mode)
 wrapper function for Adaptive binary watershed 3d algorithm More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::adaptiveBinaryWatershed3dImg (const image::ImageConstPtr &pInBinImg3d, const ipReal64 inArithmeticVal, const ipsdk::imaproc::attr::eWatershedSeparationMode &mode, const ipsdk::imaproc::attr::eWatershedProcessingMode &inOptWatershedProcMode)
 wrapper function for Adaptive binary watershed 3d algorithm More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::adaptiveBinaryWatershed3dImg (const image::ImageConstPtr &pInBinImg3d, const ipReal64 inArithmeticVal, const ipsdk::imaproc::attr::eWatershedSeparationMode &mode, const ipsdk::imaproc::attr::eWatershedProcessingMode &inOptWatershedProcMode, const image::ImagePtr &pOutBinLabImg)
 wrapper function for Adaptive binary watershed 3d algorithm More...
 

Detailed Description

Adaptive binary watershed 3d algorithm.

The 3D adaptive watershed binary sepation is a brand new algorithm developped by Reactiv'IP [1].

While standard watershed algorithm is well suited to separate objects with similar sizes and with rather circular shapes, it may have difficulties to separate more complex objects with various sizes.

Munch et al. [2] proposed an efficient adaptative algorithm to separate such objects, but its iterative nature leads to prohibitive processing times.

The adaptive watershed algorithm implemented in IPSDK is still based on the Seeded Watershed 3d algorithm, but the seeds are generated without locally considering each configuration.

In addition, the algorithm is very easy to set up since the only parameter inArithmeticVal to consider is the ratio between the size of the seed and the size of the object. The figure below illustrates in 2D the seeds for inArithmeticVal = 0.55 on a part of an image kindly provided by the 3S-R lab and used by Hassar et al. in the paper [3].

adaptiveWatershed2d_seedSizeRatio.png

Just like the Watershed Binary Separation 3d algorithm, it is possible to compute the separation lines, the basins or the splitted objects as a binary or label image.

Please, see Adaptive Watershed Binary Separation 2d for an example of result in 2D case.

[1] Bernard, L., Baptista, J., Aim, W., & Abbal, R. (2022). "A fast and adaptive solution for object separation". ICTMS 2022 https://www.linkedin.com/pulse/fast-adaptive-solution-object-separation-laurent-bernard/

[2] Munch, B., Gasser, P., Holzer, L., & Flatt, R. (2006). "FIB-Nanotomography of Particulate Systems-Part II: Particle Recognition and Effect of Boundary Truncation". Journal of the American Ceramic Society, 89(8), 2586-2595.

[3] Haffar, I., Flin, F., Geindreau, C., Petillon, N., Gervais, P.C., Edery, V. "X-ray tomography for 3D analysis of ice particles in jet A-1 fuel", Powder Technology (2021), 384, 200-210

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::InArithmeticVal [Input] value used for arithmetic operations X
ipsdk::imaproc::attr::InWatershedSeparationMode [Input] parameter allowing to define watershed separation mode X
ipsdk::imaproc::attr::InOptWatershedProcMode [Input Optional] Watershed processing mode X
ipsdk::imaproc::attr::InOptNbMinDataByThread [Input Optional] minimum number of data by thread X
ipsdk::imaproc::attr::OutOptWk1Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutOptWk1BinImg [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutOptWk1LabelImg [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutWk1BinImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1BinImg, _pInBinImg3d)
ipsdk::imaproc::attr::OutWk2BinImg [Output] Second temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk2BinImg, _pInBinImg3d)
ipsdk::imaproc::attr::OutWk1DistImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1DistImg, _pInBinImg3d, ipsdk::image::eImageBufferType::eIBT_UInt16)
ipsdk::imaproc::attr::OutWk1Img [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1Img, _pInBinImg3d, ipsdk::image::eImageBufferType::eIBT_UInt16)
ipsdk::imaproc::attr::OutWk1RealImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1RealImg, _pInBinImg3d, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutWk2RealImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk2RealImg, _pInBinImg3d, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutWk1LabelImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1LabelImg, _pInBinImg3d, ipsdk::image::eImageBufferType::eIBT_Label16)
ipsdk::imaproc::attr::OutWk2LabelImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk2LabelImg, _pInBinImg3d, ipsdk::image::eImageBufferType::eIBT_Label16)
ipsdk::imaproc::attr::OutBinLabImg [Output] binary or label image for processing operation customOutput (_pOutBinLabImg, outputWatershed(_pInBinImg3d,_pInWatershedSeparationMode))

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInBinImg3d,_pOutWk1BinImg) && 
ipsdk::imaproc::matchSizeAndType (_pInBinImg3d,_pOutWk2BinImg) && 
ipsdk::imaproc::matchSize (_pInBinImg3d,_pOutWk1DistImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutWk1DistImg,_pOutWk1Img) && 
ipsdk::imaproc::matchSize (_pInBinImg3d,_pOutWk1RealImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutWk1LabelImg,_pOutWk2LabelImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutWk1RealImg,_pOutWk2RealImg) && 
ipsdk::imaproc::matchSize (_pInBinImg3d,_pOutWk1LabelImg) && 
ipsdk::imaproc::matchSize (_pInBinImg3d,_pOutBinLabImg) && 
ipsdk::processor::ifIsSet (_pOutOptWk1Img,
 ipsdk::imaproc::matchSizeAndType (_pOutWk1DistImg,_pOutOptWk1Img)) && 
ipsdk::processor::ifIsSet (_pOutOptWk1Img,
 ipsdk::imaproc::matchSize (_pInBinImg3d,_pOutOptWk1BinImg)) && 
ipsdk::processor::ifIsSet (_pOutOptWk1Img,
 ipsdk::imaproc::matchSize (_pInBinImg3d,_pOutOptWk1LabelImg))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
import PyIPSDK.IPSDKIPLBinarization as bin

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inBinImg = bin.lightThresholdImg(inImg, 97)
# process watershed binary separation (split mode)
outImg = advmorpho.adaptiveBinaryWatershed3dImg(inBinImg, 0.1, PyIPSDK.eWatershedSeparationMode.eWSM_SplitLabel, PyIPSDK.eWPM_Repeatable)

Example of C++ code :

Example informations

Associated library

IPSDKIPLAdvancedMorphology

Header file

Code Example

// opening of input grey image
ImagePtr pInImg = loadTiffImageFile(inputBinImgPath);
ImagePtr pInBinImg = lightThresholdImg(pInImg, 97);
// process adaptive binary separation
See also
AdaptiveBinaryWatershed3dImgLvl1

Function Documentation

◆ adaptiveBinaryWatershed3dImg() [1/3]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::adaptiveBinaryWatershed3dImg ( const image::ImageConstPtr pInBinImg3d,
const ipReal64  inArithmeticVal,
const ipsdk::imaproc::attr::eWatershedSeparationMode mode 
)

wrapper function for Adaptive binary watershed 3d algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ adaptiveBinaryWatershed3dImg() [2/3]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::adaptiveBinaryWatershed3dImg ( const image::ImageConstPtr pInBinImg3d,
const ipReal64  inArithmeticVal,
const ipsdk::imaproc::attr::eWatershedSeparationMode mode,
const ipsdk::imaproc::attr::eWatershedProcessingMode inOptWatershedProcMode 
)

wrapper function for Adaptive binary watershed 3d algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ adaptiveBinaryWatershed3dImg() [3/3]

IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::adaptiveBinaryWatershed3dImg ( const image::ImageConstPtr pInBinImg3d,
const ipReal64  inArithmeticVal,
const ipsdk::imaproc::attr::eWatershedSeparationMode mode,
const ipsdk::imaproc::attr::eWatershedProcessingMode inOptWatershedProcMode,
const image::ImagePtr pOutBinLabImg 
)

wrapper function for Adaptive binary watershed 3d algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure