image = | shapeToLabel3dImg (inLabelsShape3d) |
image = | shapeToLabel3dImg (inPILabelsShape3d) |
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
inImg = PyIPSDK.loadTiffImageFile(inputImgPath,
PyIPSDK.eTiffDirectoryMode.eTDM_Volume,
PyIPSDK.eTiffBufferMode.eTBM_Binary)
inLabelImg3d = advmorpho.connectedComponent3dImg(inImg)
outShape3dColl = shapesegmentation.labelShapeExtraction3d(inLabelImg3d)
outLabelImg = shapesegmentation.shapeToLabel3dImg(outShape3dColl);
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLShapeSegmentation/Processor/ShapeToLabel3dImg/ShapeToLabel3dImg.h>
Code Example
eTiffDirectoryMode::eTDM_Volume,
eTiffBufferMode::eTBM_Binary);
ImagePtr pOutLabelImg = shapeToLabel3dImg(pShape3dColl);