Measure allowing to get the first voxel for 3d shape.
This measure gets the coordinates (x,y,z) of the first voxel found for each shape.
Here is an example of first voxel measurement in 3d case :
Get the first voxel for each 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, "FirstPixel3dMsr")
outMeasureSet = shapeanalysis.labelAnalysis3d(inGreyImg, inLabelImg, inMeasureInfoSet3d)
PyIPSDK.saveCsvMeasureFile(os.path.join(tmpPath, "shape_analysis_results.csv"), outMeasureSet)
outMsr = outMeasureSet.getMeasure("FirstPixel3dMsr")
outMsrValues = outMsr.getMeasureResult().getColl(0)
print("First label measurement equal " + str(outMsrValues[1]))
Example of C++ code :
Example informations
Associated library
IPSDKIPLShapeAnalysis
Code Example
Shape3dCollPtr pShape3dColl = boost::make_shared<Shape3dColl>();
IPSDK_REQUIRE(readFromXmlFile(inputShape3dCollPath, *pShape3dColl) == true);
MeasureInfoSetPtr pMeasureInfoSet = MeasureInfoSet::create3dInstance();
createMeasureInfo(pMeasureInfoSet, "FirstPixel3dMsr");
MeasureSetPtr pOutMeasureSet =
shapeAnalysis3d(pInGreyImg3d, pShape3dColl, pMeasureInfoSet);
const MeasureConstPtr& pFirstPixel3dOutMsr = pOutMeasureSet->getMeasure("FirstPixel3dMsr");
const FirstPixel3dMsrResults& outResults = static_cast<const FirstPixel3dMsrResults&>(pFirstPixel3dOutMsr->getMeasureResult());