Creates a rectangular selection. Removes any existing selection if width or height are less than 1.
(int x, int y, int width, int height)
| 1373 | /** Creates a rectangular selection. Removes any existing |
| 1374 | selection if width or height are less than 1. */ |
| 1375 | public static void makeRectangle(int x, int y, int width, int height) { |
| 1376 | if (width<=0 || height<0) |
| 1377 | getImage().deleteRoi(); |
| 1378 | else { |
| 1379 | ImagePlus img = getImage(); |
| 1380 | if (Interpreter.isBatchMode()) |
| 1381 | img.setRoi(new Roi(x,y,width,height), false); |
| 1382 | else |
| 1383 | img.setRoi(x, y, width, height); |
| 1384 | } |
| 1385 | } |
| 1386 | |
| 1387 | /** Creates a subpixel resolution rectangular selection. */ |
| 1388 | public static void makeRectangle(double x, double y, double width, double height) { |
no test coverage detected