IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Shape Filtering 3dSee full documentation
imageshapeFiltering3dImg (inBinLabImg,inFilterFormula)
imageshapeFiltering3dImg (inBinLabImg,inGreyMsrImg,inFilterFormula)
imageshapeFiltering3dImg (inBinLabImg,inFilterFormula,inOptExtractionSettings)
imageshapeFiltering3dImg (inBinLabImg,inGreyMsrImg,inFilterFormula,inOptExtractionSettings)
imageshapeFiltering3dImg (inBinLabImg,inFilterFormula,inOptMeasureInfoSet3d)
imageshapeFiltering3dImg (inBinLabImg,inGreyMsrImg,inFilterFormula,inOptMeasureInfoSet3d)

Detailed Description

Shape 3d filtering algorithm.

This algorithm allows to filter an input 3d binary or label image with respect to a shape analysis measure formula.

OutImg output image type is given by InBinLabImg3d input image type which can be a binary or a label 3d image.

This is a packaged algorithm which can be decomposed into the following steps :

Used InFilterFormula formula must be evaluated to a valid measure logic formula (see Logic Formula and Shape Analysis 3d). InGreyMsrImg3d is a grey level (or color) 3d image which can be used to compute intensity measurements.

Additional measures definition can be provided using InOptMeasureInfoSet3d attribute. This allows to create user custom parametred measures (such as histogram quantile which depends on a target quantile value).

Here is an example of shape 3d filtering operation where all small shapes are removed (used formula : $Volume3dMsr > 4000$)

shapeFiltering3dImg1.png

In this case input binary image (on the left) is filtered using a geometric criterion. Intermediate label (connected components) image and measurement results are displayed (on center) before final binary image result (on the right).

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLShapeAnalysis as shapeanalysis

Code Example

# opening binary input image
inBinImg = PyIPSDK.loadTiffImageFile(inputBinImgPath)
# shape filtering computation
outImg1 = shapeanalysis.shapeFiltering3dImg(inBinImg, "Volume3dMsr > 8000")
# opening grey level input image
inGreyImg = PyIPSDK.loadTiffImageFile(inputGreyImgPath)
# process of shape filtering with custom measure parameters
measureInfoSet = PyIPSDK.createMeasureInfoSet3d()
PyIPSDK.createMeasureInfo(measureInfoSet, "MyQuantileMsr", "HistogramQuantileMsr", shapeanalysis.createHistogramQuantileMsrParamsBinWidth(1.0, 75.0))
outImg2 = shapeanalysis.shapeFiltering3dImg(inBinImg, inGreyImg, "MyQuantileMsr > 100", measureInfoSet)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLShapeAnalysis/Processor/ShapeFiltering3dImg/ShapeFiltering3dImg.h>

Code Example

// opening binary input image
ImagePtr pInBinImg3d = loadTiffImageFile(inputBinImgPath);
// process of shape filtering in simple case
const std::string formulaStr1 = "Volume3dMsr > 8000";
ImagePtr pOutImg1 = shapeFiltering3dImg(pInBinImg3d, formulaStr1);
// opening grey level input image
ImagePtr pInGreyImg3d = loadTiffImageFile(inputGreyImgPath);
// process of shape filtering with custom measure parameters
MeasureInfoSetPtr pMeasureInfoSet = MeasureInfoSet::create3dInstance();
createMeasureInfo(pMeasureInfoSet, "MyQuantileMsr", "HistogramQuantileMsr", createHistogramQuantileMsrParamsBinWidth(1.0, 75.0));
const std::string formulaStr2 = "MyQuantileMsr > 100";
ImagePtr pOutImg2 = shapeFiltering3dImg(pInBinImg3d, pInGreyImg3d, formulaStr2, pMeasureInfoSet);