MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / convexHull

Method convexHull

ij/src/main/java/ij/plugin/Selection.java:573–588  ·  view source on GitHub ↗
(ImagePlus imp)

Source from the content-addressed store, hash-verified

571 }
572
573 void convexHull(ImagePlus imp) {
574 if (!imp.okToDeleteRoi()) return;
575 long startTime = System.currentTimeMillis();
576 Roi roi = imp.getRoi();
577 if (roi == null) { IJ.error("Convex Hull", "Selection required"); return; }
578 if (roi instanceof Line) { IJ.error("Convex Hull", "Area selection, point selection, or segmented or free line required"); return; }
579 FloatPolygon p = roi.getFloatConvexHull();
580 if (p!=null) {
581 Undo.setup(Undo.ROI, imp);
582 imp.deleteRoi();
583 Roi roi2 = new PolygonRoi(p, Roi.POLYGON);
584 transferProperties(roi, roi2);
585 imp.setRoi(roi2);
586 IJ.showTime(imp, startTime, "Convex Hull ", 1);
587 }
588 }
589
590 // Finds the index of the upper right point that is guaranteed to be on convex hull
591 /*int findFirstPoint(int[] xCoordinates, int[] yCoordinates, int n, ImagePlus imp) {

Callers 1

runMethod · 0.95

Calls 9

errorMethod · 0.95
getFloatConvexHullMethod · 0.95
setupMethod · 0.95
transferPropertiesMethod · 0.95
showTimeMethod · 0.95
okToDeleteRoiMethod · 0.80
deleteRoiMethod · 0.80
getRoiMethod · 0.45
setRoiMethod · 0.45

Tested by

no test coverage detected