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

Method getBounds

ij/src/main/java/ij/macro/Functions.java:2858–2885  ·  view source on GitHub ↗
(boolean intValues)

Source from the content-addressed store, hash-verified

2856 }
2857
2858 void getBounds(boolean intValues) {
2859 Variable x = getFirstVariable();
2860 Variable y = getNextVariable();
2861 Variable width = getNextVariable();
2862 Variable height = getLastVariable();
2863 ImagePlus imp = getImage();
2864 Roi roi = imp.getRoi();
2865 if (roi!=null) {
2866 if (intValues) {
2867 Rectangle r = roi.getBounds();
2868 x.setValue(r.x);
2869 y.setValue(r.y);
2870 width.setValue(r.width);
2871 height.setValue(r.height);
2872 } else {
2873 Rectangle2D.Double r = roi.getFloatBounds();
2874 x.setValue(r.x);
2875 y.setValue(r.y);
2876 width.setValue(r.width);
2877 height.setValue(r.height);
2878 }
2879 } else {
2880 x.setValue(0);
2881 y.setValue(0);
2882 width.setValue(imp.getWidth());
2883 height.setValue(imp.getHeight());
2884 }
2885 }
2886
2887 String substring(String s) {
2888 s = getStringFunctionArg(s);

Callers 2

doFunctionMethod · 0.95
doRoiMethod · 0.95

Calls 10

getFirstVariableMethod · 0.95
getNextVariableMethod · 0.95
getLastVariableMethod · 0.95
getImageMethod · 0.95
getRoiMethod · 0.95
getBoundsMethod · 0.95
setValueMethod · 0.95
getFloatBoundsMethod · 0.95
getWidthMethod · 0.95
getHeightMethod · 0.95

Tested by

no test coverage detected