image = | shapeFiltering3dImg (inBinLabImg,inFilterFormula) |
image = | shapeFiltering3dImg (inBinLabImg,inGreyMsrImg,inFilterFormula) |
image = | shapeFiltering3dImg (inBinLabImg,inFilterFormula,inOptExtractionSettings) |
image = | shapeFiltering3dImg (inBinLabImg,inGreyMsrImg,inFilterFormula,inOptExtractionSettings) |
image = | shapeFiltering3dImg (inBinLabImg,inFilterFormula,inOptMeasureInfoSet3d) |
image = | shapeFiltering3dImg (inBinLabImg,inGreyMsrImg,inFilterFormula,inOptMeasureInfoSet3d) |
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 :
- A first optional step which allows to compute connected components on input 3d image and to obtain a label 3d image (see Connected Component 3d).
- A second step allowing to extract shapes from previous labels(see Label shape extraction 3d)
- The main shape analysis step including formula computation.
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).
- The final step simply consists in a lut transformation. An input shape will then retrieve its original value (1 for a binary image or its label index for a label image) if it matches requested InFilterFormula formula.
Here is an example of shape 3d filtering operation where all small shapes are removed (used formula :
)
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
inBinImg = PyIPSDK.loadTiffImageFile(inputBinImgPath)
outImg1 = shapeanalysis.shapeFiltering3dImg(inBinImg, "Volume3dMsr > 8000")
inGreyImg = PyIPSDK.loadTiffImageFile(inputGreyImgPath)
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
const std::string formulaStr1 = "Volume3dMsr > 8000";
ImagePtr pOutImg1 = shapeFiltering3dImg(pInBinImg3d, formulaStr1);
MeasureInfoSetPtr pMeasureInfoSet = MeasureInfoSet::create3dInstance();
const std::string formulaStr2 = "MyQuantileMsr > 100";
ImagePtr pOutImg2 = shapeFiltering3dImg(pInBinImg3d, pInGreyImg3d, formulaStr2, pMeasureInfoSet);