IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Shape extraction from label 3d image algorithm. More...

IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::Shape3dCollPtr ipsdk::imaproc::shape::segmentation::labelShapeExtraction3d (const ipsdk::image::ImageConstPtr &pInLabelImg3d)
 wrapper function for shape extraction from label 3d image algorithm More...
 
IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::Shape3dCollPtr ipsdk::imaproc::shape::segmentation::labelShapeExtraction3d (const ipsdk::image::ImageConstPtr &pInLabelImg3d, const ipsdk::imaproc::attr::SurfaceExtractionSettingsConstPtr &pInOptSurfaceExtractionSettings)
 wrapper function for shape extraction from label 3d image algorithm More...
 
IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::PlanIndexedShape3dCollPtr ipsdk::imaproc::shape::segmentation::multiSlice_labelShapeExtraction3d (const ipsdk::image::ImageConstPtr &pInLabelImg3d)
 wrapper function for shape extraction from label 3d image algorithm More...
 
IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::PlanIndexedShape3dCollPtr ipsdk::imaproc::shape::segmentation::multiSlice_labelShapeExtraction3d (const ipsdk::image::ImageConstPtr &pInLabelImg3d, const ipsdk::imaproc::attr::SurfaceExtractionSettingsConstPtr &pInOptSurfaceExtractionSettings)
 wrapper function for shape extraction from label 3d image algorithm More...
 

Detailed Description

Shape extraction from label 3d image algorithm.

This algorithm allows to extract 3d shapes from a label (see Connected Component 3d) input 3d image. This extraction is a required step to be able to proceed to 3d shapes analysis (Shape Analysis 3d). Shapes extracted with this algorithm are then made of 2 parts:

Here is an example of a 3d shape extraction on our binary test image imageMorphoBin3d6.tif, on which a 3d connected component algorithm has been applied to get the associated label image:

labelShapeExtraction3d.png
Note
: the light blue ellipsoid and the dark blue sphere are drawn transparent, to see respectively the green shape behind the ellipsoid and the two holes inside the sphere.

imageMorphoBin3d6.tif is a 3d binary image (background in black, shapes in white), in which the following shapes were drawn:

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InLabelImg3d [Input] label image 3d for processing operation X
ipsdk::imaproc::attr::InOptSurfaceExtractionSettings [Input Optional] Settings used for surfaces extraction X
ipsdk::imaproc::attr::OutPILabelsShape3d [Output] Plan indexed collection of shape 3d associated to labels ipsdk::imaproc::fromImage (_pOutPILabelsShape3d, _pInLabelImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchImagePlans (_pOutPILabelsShape3d,_pInLabelImg3d,eImagePlansMatchPolicy::eIPMP_CT)

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)
# connected components analysis
inLabelImg3d = advmorpho.connectedComponent3dImg(inImg)
# label shape extraction computation with fine marching cube step and no mesh simplification
outShape3dColl = shapesegmentation.labelShapeExtraction3d(inLabelImg3d)
# label shape extraction computation with surface extraction parameters with fine marching cube step,
# and mesh simplification
simplifiedSurfaceExtractionSettings = PyIPSDK.createSimplifiedSurfaceExtractionSettings(0.9, 100)
outShape3dCollSimplified = shapesegmentation.labelShapeExtraction3d(inLabelImg3d, simplifiedSurfaceExtractionSettings)
# label shape extraction computation with surface extraction parameters with coarse marching cube step
# and no mesh simplification
coarseSurfaceExtractionSettings = PyIPSDK.createSubSampledSurfaceExtractionSettings(2)
outShape3dCollCoarse = shapesegmentation.labelShapeExtraction3d(inLabelImg3d, coarseSurfaceExtractionSettings)

Example of C++ code :

Example informations

Associated library

IPSDKIPLShapeSegmentation

Header file

Code Example

// opening input image
ImagePtr pInBinImg3d = loadTiffImageFile(inputBinImgPath, eTiffDirectoryMode::eTDM_Volume);
// connected components analysis
ImagePtr pInLabelImg3d = connectedComponent3dImg(pInBinImg3d);
// create the settings used for the surface extraction with ratio and
// minimum number of triangles for the simplification of mesh
SurfaceExtractionSettingsPtr pSurfaceExtractionSettings =
// extract contours from connected component (label) image
Shape3dCollPtr pOutColl = labelShapeExtraction3d(pInLabelImg3d, pSurfaceExtractionSettings);
See also
LabelShapeExtraction3dLvl1

Function Documentation

◆ labelShapeExtraction3d() [1/2]

IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::Shape3dCollPtr ipsdk::imaproc::shape::segmentation::labelShapeExtraction3d ( const ipsdk::image::ImageConstPtr pInLabelImg3d)

wrapper function for shape extraction from label 3d image algorithm

Note
This wrapper must be used with mono slice (sizeC=sizeT=1) input images
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_labelShapeExtraction3d() [1/2]

IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::PlanIndexedShape3dCollPtr ipsdk::imaproc::shape::segmentation::multiSlice_labelShapeExtraction3d ( const ipsdk::image::ImageConstPtr pInLabelImg3d)

wrapper function for shape extraction from label 3d image algorithm

Note
This wrapper can be used with multi slice input images
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ labelShapeExtraction3d() [2/2]

IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::Shape3dCollPtr ipsdk::imaproc::shape::segmentation::labelShapeExtraction3d ( const ipsdk::image::ImageConstPtr pInLabelImg3d,
const ipsdk::imaproc::attr::SurfaceExtractionSettingsConstPtr pInOptSurfaceExtractionSettings 
)

wrapper function for shape extraction from label 3d image algorithm

Note
This wrapper must be used with mono slice (sizeC=sizeT=1) input images
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_labelShapeExtraction3d() [2/2]

IPSDKIPLSHAPESEGMENTATION_API ipsdk::shape::segmentation::PlanIndexedShape3dCollPtr ipsdk::imaproc::shape::segmentation::multiSlice_labelShapeExtraction3d ( const ipsdk::image::ImageConstPtr pInLabelImg3d,
const ipsdk::imaproc::attr::SurfaceExtractionSettingsConstPtr pInOptSurfaceExtractionSettings 
)

wrapper function for shape extraction from label 3d image algorithm

Note
This wrapper can be used with multi slice input images
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure