/** * Adds the specified paths to the list of ROI of the image plus. * * @param target The ImagePlus that will be associated with ROIS * @param geodDiams the list of paths */ public void createPathRois(ImagePlus target, Map<Integer, GeodesicDiameter.Result> geodDiams) { // get instance of ROI Manager RoiManager manager = RoiManager.getRoiManager(); Calibration calib = target.getCalibration(); // add each path to the ROI Manager int index = 0; for (GeodesicDiameter.Result result : geodDiams.values()) { manager.add(target, createPathRoi(result.path, calib), index++); } }
@Override public void process(final Module module) { // assign singleton RoiManager to single RoiManager input final ModuleItem<RoiManager> roiManagerInput = moduleService.getSingleInput( module, RoiManager.class); if (roiManagerInput != null) { RoiManager roiManager; if (roiManagerInput.isRequired()) { roiManager = RoiManager.getRoiManager(); } else { roiManager = RoiManager.getInstance(); } if (roiManager == null) return; module.setInput(roiManagerInput.getName(), roiManager); module.resolveInput(roiManagerInput.getName()); } } }