IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Set the intensity to 1 if the number of neighbours with higher values are greater than the specified input value. More...

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::checkMultiphasedNeighourhood2dImg (const image::ImageConstPtr &pInLabelImg, const ipUInt32 nbLabels, const ipBool bIgnoreForeground)
 wrapper function for Set the intensity to 1 if the number of neighbours with higher values are greater than the specified input value More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::checkMultiphasedNeighourhood2dImg (const image::ImageConstPtr &pInLabelImg, const ipUInt32 nbLabels, const ipBool bIgnoreForeground, const image::ImagePtr &pOutImg)
 wrapper function for Set the intensity to 1 if the number of neighbours with higher values are greater than the specified input value More...
 

Detailed Description

Set the intensity to 1 if the number of neighbours with higher values are greater than the specified input value.

Given an input label image, the algorithm computes a binary image in which pixels are set to 1 if the label image counts at least InNbLabels different labels in its 3x3 neighbourhood.

It is possible to process only background pixels by setting the InIgnoreForeground flag to true.

Here is an example of an result for InNbLabels = 3 (the selected pixels are displayed in green):

checkMultiphasedNeighourhood2dImg.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InLabelImg [Input] label image for processing operation X
ipsdk::imaproc::attr::InNbLabels [Input] number of labels for processing operation X
ipsdk::imaproc::attr::InIgnoreForeground [Input] Flags indicating if the forground is ignored during a calculation X
ipsdk::imaproc::attr::OutBinImg [Output] binary image for processing operation ipsdk::imaproc::duplicateInOut (_pOutBinImg, _pInLabelImg, ipsdk::image::eImageBufferType::eIBT_Binary)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInLabelImg,_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 3d image computation
outImg = morpho.checkMultiphasedNeighourhood2dImg(inImg, 3, True)

Example of C++ code :

Example informations

Associated library

IPSDKIPLBasicMorphology

Header file

Code Example

// opening input image
ImagePtr pInLabelImg = loadTiffImageFile(inputImgPath);
// compute boundary on input image
ImagePtr pOutImg = checkMultiphasedNeighourhood2dImg(pInLabelImg, 3, bIgnoreForeground);
See also
CheckMultiphasedNeighourhood2dImgLvl1
CheckMultiphasedNeighourhood2dImgLvl2
CheckMultiphasedNeighourhood2dImgLvl3

Function Documentation

◆ checkMultiphasedNeighourhood2dImg() [1/2]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::checkMultiphasedNeighourhood2dImg ( const image::ImageConstPtr pInLabelImg,
const ipUInt32  nbLabels,
const ipBool  bIgnoreForeground 
)

wrapper function for Set the intensity to 1 if the number of neighbours with higher values are greater than the specified input value

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ checkMultiphasedNeighourhood2dImg() [2/2]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::checkMultiphasedNeighourhood2dImg ( const image::ImageConstPtr pInLabelImg,
const ipUInt32  nbLabels,
const ipBool  bIgnoreForeground,
const image::ImagePtr pOutImg 
)

wrapper function for Set the intensity to 1 if the number of neighbours with higher values are greater than the specified input value

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure