/** * Get the ROI for a PathObject, with a preference for the nucleus ROI of a cell. * * @param pathObject * @param preferNucleus * @return */ public static ROI getROI(final PathObject pathObject, final boolean preferNucleus) { if (preferNucleus && pathObject instanceof PathCellObject) { ROI roi = ((PathCellObject)pathObject).getNucleusROI(); if (roi != null) return roi; } return pathObject.getROI(); }
@Override public void run() { try { MeasurementList measurementList = parentObject.getMeasurementList(); ROI roi; if (parentObject instanceof PathCellObject) { roi = ((PathCellObject)parentObject).getNucleusROI(); if (roi instanceof PathArea) addMeasurements(measurementList, (PathArea)roi, "Nucleus Shape: ", pixelWidth, pixelHeight, unit, doArea, doPerimeter, doCircularity); roi = parentObject.getROI(); if (roi instanceof PathArea) addMeasurements(measurementList, (PathArea)roi, "Cell Shape: ", pixelWidth, pixelHeight, unit, doArea, doPerimeter, doCircularity); } else { roi = parentObject.getROI(); if (roi instanceof PathArea) addMeasurements(measurementList, (PathArea)roi, "ROI Shape: ", pixelWidth, pixelHeight, unit, doArea, doPerimeter, doCircularity); } measurementList.closeList(); } catch (Exception e) { e.printStackTrace(); throw(e); } } });
pathROI = ((PathCellObject)pathObject).getNucleusROI(); else pathROI = pathObject.getROI();
ROI pathROIInner = useCellNucleiForInsideTest && (pathObject instanceof PathCellObject) ? ((PathCellObject)pathObject).getNucleusROI() : pathROI; //J if (useTileCentroidsForInsideTest && pathObject instanceof PathDetectionObject && !(pathROIInner instanceof PointsROI)) { double cx = pathROIInner.getCentroidX(); ROI nucleusROI = ((PathCellObject)temp).getNucleusROI(); if (nucleusROI != null) tempROIInner = nucleusROI;