/** * Gets a {@link Geometry} from an input {@link ROI}. * * @param roi the ROI * @return a {@link Geometry} instance from the provided input; * null in case the input roi is neither a geometry, nor a shape. */ private Geometry getGeometry(ROI roi){ if (roi instanceof ROIGeometry){ return ((ROIGeometry) roi).getAsGeometry(); } else if (roi instanceof ROIShape){ final Shape shape = ((ROIShape) roi).getAsShape(); final Geometry geom = ShapeReader.read(shape, 0, geomFactory); geom.apply(Y_INVERSION); return geom; } return null; }
for (int i=0; i<rois.length; i++){ if (globalRoi == null){ globalRoi = new ROIGeometry(((ROIGeometry)rois[i]).getAsGeometry()); } else { globalRoi = globalRoi.add(rois[i]);