IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

algorithm allowing to create a label 2d image from a collection of shape More...

IPSDKIPLSHAPESEGMENTATION_API ipsdk::image::ImagePtr ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg (const ipsdk::shape::segmentation::Shape2dCollConstPtr &pInLabelsShape2d)
 wrapper function for algorithm allowing to create a label 2d image from a collection of shape More...
 
IPSDKIPLSHAPESEGMENTATION_API ipsdk::image::ImagePtr ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg (const ipsdk::shape::segmentation::PlanIndexedShape2dCollConstPtr &pInPILabelsShape2d)
 wrapper function for algorithm allowing to create a label 2d image from a collection of shape More...
 
IPSDKIPLSHAPESEGMENTATION_API void ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg (const ipsdk::shape::segmentation::Shape2dCollConstPtr &pInLabelsShape2d, const ipsdk::image::ImagePtr &pOutLabelImg)
 wrapper function for algorithm allowing to create a label 2d image from a collection of shape More...
 
IPSDKIPLSHAPESEGMENTATION_API void ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg (const ipsdk::shape::segmentation::PlanIndexedShape2dCollConstPtr &pInPILabelsShape2d, const ipsdk::image::ImagePtr &pOutLabelImg)
 wrapper function for algorithm allowing to create a label 2d image from a collection of shape More...
 

Detailed Description

algorithm allowing to create a label 2d image from a collection of shape

This algorithm allows to re-create a label image (Connected Component 2d) from a shape 2d image. Shape intersection with image rows are set with respect to shape label.

Note
if some shape intersect, intersection pixels are set to highest label value.

Here is an example of a shape to label 2d image operation :

shapeToLabel2dImg.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InPILabelsShape2d [Input] Plan indexed collection of shape 2d associated to labels X
ipsdk::imaproc::attr::OutLabelImg [Output] label image for processing operation customOutput (_pOutLabelImg, outputShapeToLabel(_pInPILabelsShape2d))

Global Rule description

Global rule description for algorithm :
ipsdk::processor::none ()

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
import PyIPSDK.IPSDKIPLShapeSegmentation as shapesegmentation

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath,
PyIPSDK.eTiffDirectoryMode.eTDM_Volume,
PyIPSDK.eTiffBufferMode.eTBM_Binary)
# connected components analysis
inLabelImg2d = advmorpho.connectedComponent2dImg(inImg)
# label contour extraction computation
outShape2dColl = shapesegmentation.labelShapeExtraction2d(inLabelImg2d)
# write extracted shapes to output label image
outLabelImg = shapesegmentation.shapeToLabel2dImg(outShape2dColl);

Example of C++ code :

Example informations

Associated library

IPSDKIPLShapeSegmentation

Header file

Code Example

// opening input image
ImagePtr pInBinImg2d = loadTiffImageFile(inputBinImgPath,
eTiffDirectoryMode::eTDM_Volume,
eTiffBufferMode::eTBM_Binary);
// connected components analysis
ImagePtr pInLabelImg2d = connectedComponent2dImg(pInBinImg2d);
// extract contours from connected component (label) image
Shape2dCollPtr pShape2dColl = labelShapeExtraction2d(pInLabelImg2d);
// write extracted shapes to output label image
ImagePtr pOutLabelImg = shapeToLabel2dImg(pShape2dColl);
See also
ShapeToLabel2dImgLvl1
ShapeToLabel2dImgLvl2
ShapeToLabel2dImgLvl3

Function Documentation

◆ shapeToLabel2dImg() [1/4]

IPSDKIPLSHAPESEGMENTATION_API ipsdk::image::ImagePtr ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg ( const ipsdk::shape::segmentation::Shape2dCollConstPtr pInLabelsShape2d)

wrapper function for algorithm allowing to create a label 2d image from a collection of shape

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ shapeToLabel2dImg() [2/4]

IPSDKIPLSHAPESEGMENTATION_API ipsdk::image::ImagePtr ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg ( const ipsdk::shape::segmentation::PlanIndexedShape2dCollConstPtr pInPILabelsShape2d)

wrapper function for algorithm allowing to create a label 2d image from a collection of shape

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ shapeToLabel2dImg() [3/4]

IPSDKIPLSHAPESEGMENTATION_API void ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg ( const ipsdk::shape::segmentation::Shape2dCollConstPtr pInLabelsShape2d,
const ipsdk::image::ImagePtr pOutLabelImg 
)

wrapper function for algorithm allowing to create a label 2d image from a collection of shape

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ shapeToLabel2dImg() [4/4]

IPSDKIPLSHAPESEGMENTATION_API void ipsdk::imaproc::shape::segmentation::shapeToLabel2dImg ( const ipsdk::shape::segmentation::PlanIndexedShape2dCollConstPtr pInPILabelsShape2d,
const ipsdk::image::ImagePtr pOutLabelImg 
)

wrapper function for algorithm allowing to create a label 2d image from a collection of shape

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure