IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Shape to label 3d imageSee full documentation
imageshapeToLabel3dImg (inLabelsShape3d)
imageshapeToLabel3dImg (inPILabelsShape3d)

Detailed Description

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

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

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

An example of shape to label image algorithm is illustrated in 2d case : see Shape to label 2d image.

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
inLabelImg3d = advmorpho.connectedComponent3dImg(inImg)
# label contour extraction computation
outShape3dColl = shapesegmentation.labelShapeExtraction3d(inLabelImg3d)
# write extracted shapes to output label image
outLabelImg = shapesegmentation.shapeToLabel3dImg(outShape3dColl);

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLShapeSegmentation/Processor/ShapeToLabel3dImg/ShapeToLabel3dImg.h>

Code Example

// opening input image
ImagePtr pInBinImg3d = loadTiffImageFile(inputBinImgPath,
eTiffDirectoryMode::eTDM_Volume,
eTiffBufferMode::eTBM_Binary);
// connected components analysis
ImagePtr pInLabelImg3d = connectedComponent3dImg(pInBinImg3d);
// extract contours from connected component (label) image
Shape3dCollPtr pShape3dColl = labelShapeExtraction3d(pInLabelImg3d);
// write extracted shapes to output label image
ImagePtr pOutLabelImg = shapeToLabel3dImg(pShape3dColl);