Measure allowing to check whether a shape has contact with image borders.
This measure allows to check whether a shape is in contact with each one of image borders.
Here is an example of result for this measure:
Measure allowing to check whether a shape has contact with image borders
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, "ImageBordersContact3dMsr")
outMeasureSet = shapeanalysis.labelAnalysis3d(inGreyImg, inLabelImg, inMeasureInfoSet3d)
PyIPSDK.saveCsvMeasureFile(os.path.join(tmpPath, "shape_analysis_results.csv"), outMeasureSet)
outMsr = outMeasureSet.getMeasure("ImageBordersContact3dMsr")
outMsrValues = outMsr.getMeasureResult().getColl(0)
print("First label measurement field bTouchXStart equal " + str(outMsrValues[1].bTouchXStart))
Example of C++ code :
Example informations
Associated library
IPSDKIPLShapeAnalysis
Code Example
ImagePtr pInGreyImg3d =
loadTiffImageFile(inputGreyImgPath, eTiffDirectoryMode::eTDM_Volume);
Shape3dCollPtr pShape3dColl = boost::make_shared<Shape3dColl>();
IPSDK_REQUIRE(readFromXmlFile(inputShape3dCollPath, *pShape3dColl) == true);
MeasureInfoSetPtr pMeasureInfoSet = MeasureInfoSet::create3dInstance();
createMeasureInfo(pMeasureInfoSet, "ImageBordersContact3dMsr");
MeasureSetPtr pOutMeasureSet =
shapeAnalysis3d(pInGreyImg3d, pShape3dColl, pMeasureInfoSet);
const MeasureConstPtr& pImageBordersContact3dOutMsr = pOutMeasureSet->getMeasure("ImageBordersContact3dMsr");
const ImageBordersContactMsrResults& outResults = static_cast<const ImageBordersContactMsrResults&>(pImageBordersContact3dOutMsr->getMeasureResult());