private void addPolyLineToOverlay(final FloatPolygon p, final int z_position, final int roi_id, final Overlay overlay) { if (p.npoints > 0) { if (p.npoints == 1) { // create 1-pixel length lines for single points p.xpoints[0] -= 0.5f; p.ypoints[0] -= 0.5f; p.addPoint(p.xpoints[0] + 0.5f, p.ypoints[0] + 0.5f); } final PolygonRoi polyline = new PolygonRoi(p, Roi.FREELINE); polyline.enableSubPixelResolution(); // polyline.fitSplineForStraightening(); if (name == null) setDefaultName(); polyline.setStrokeColor(getColor()); polyline.setName(String.format(name + "-%04d-Z%d", roi_id, z_position)); polyline.setPosition(z_position + 1); // index 1 overlay.add(polyline); } }
if (roi.getStroke()!=null) p.setStrokeWidth(roi.getStrokeWidth()); p.setStrokeColor(roi.getStrokeColor()); p.setDrawOffset(roi.getDrawOffset()); p.setName(roi.getName());
if (roi.getStroke()!=null) p.setStrokeWidth(roi.getStrokeWidth()); p.setStrokeColor(roi.getStrokeColor()); p.setDrawOffset(roi.getDrawOffset()); p.setName(roi.getName());
if (roi.getStroke()!=null) p.setStrokeWidth(roi.getStrokeWidth()); p.setStrokeColor(roi.getStrokeColor()); p.setName(roi.getName()); imp.setRoi(p);
if (roi.getStroke()!=null) p.setStrokeWidth(roi.getStrokeWidth()); p.setStrokeColor(roi.getStrokeColor()); p.setName(roi.getName()); imp.setRoi(p);