Measure allowing to compute the second order moment for 3d shape.
The Inertia3d measurement computes the second order central moment for each shape, without taking the pixels intensities into consideration.
It is equivalent to GreyInertia with all voxels intensities set to 1 in 3d case.
Here is an example of the inertia calculation :
Measure allowing to compute the second order moment for 3d shape
Measure synthesis :
Measure Type | Measure Unit Type | Parameter Type | Result Type | Shape Requirements |
Geometry 3d
|
None
|
None
|
Custom
|
Row Intersections
|
See Shape measurement for additional information on these pictograms Example of Python code :
Generic example in 3d case :
import PyIPSDK
import PyIPSDK.IPSDKIPLShapeAnalysis as shapeanalysis
inMeasureInfoSet3d = PyIPSDK.createMeasureInfoSet3d()
PyIPSDK.createMeasureInfo(inMeasureInfoSet3d, "Inertia3dMsr")
outMeasureSet = shapeanalysis.labelAnalysis3d(inGreyImg, inLabelImg, inMeasureInfoSet3d)
PyIPSDK.saveCsvMeasureFile(os.path.join(tmpPath, "shape_analysis_results.csv"), outMeasureSet)
outMsr = outMeasureSet.getMeasure("Inertia3dMsr")
outMsrValues = outMsr.getMeasureResult().getColl(0)
print("First label inertia mxx component measurement equal " + str(outMsrValues[1].mxx()))
Example of C++ code :
Example informations
Associated library
IPSDKIPLShapeAnalysis
Code Example
Shape3dCollPtr pShape3dColl = boost::make_shared<Shape3dColl>();
readFromBinaryFile(inputShape3dCollPath, *pShape3dColl);
MeasureInfoSetPtr pMeasureInfoSet = MeasureInfoSet::create3dInstance();
createMeasureInfo(pMeasureInfoSet, "Inertia3dMsr");
MeasureSetPtr pOutMeasureSet =
shapeAnalysis3d(pInGreyImg3d, pShape3dColl, pMeasureInfoSet);
const MeasureConstPtr& pInertia3dOutMsr = pOutMeasureSet->getMeasure("Inertia3dMsr");
const Inertia3dMsrResults& outResults = static_cast<const Inertia3dMsrResults&>(pInertia3dOutMsr->getMeasureResult());