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

Method makeRectangle

ij/src/main/java/ij/IJ.java:1375–1385  ·  view source on GitHub ↗

Creates a rectangular selection. Removes any existing selection if width or height are less than 1.

(int x, int y, int width, int height)

Source from the content-addressed store, hash-verified

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) {

Callers 1

makeRectangleMethod · 0.95

Calls 4

getImageMethod · 0.95
isBatchModeMethod · 0.95
setRoiMethod · 0.95
deleteRoiMethod · 0.80

Tested by

no test coverage detected