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

Method is

ij/src/main/java/ij/macro/Functions.java:5029–5073  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5027 }
5028
5029 double is() {
5030 boolean state = false;
5031 String arg = getStringArg();
5032 arg = arg.toLowerCase(Locale.US);
5033 if (arg.equals("locked"))
5034 state = getImage().isLocked();
5035 else if (arg.contains("invert") && arg.contains("lut"))
5036 state = getImage().isInvertedLut();
5037 else if (arg.indexOf("hyper")!=-1)
5038 state = getImage().isHyperStack();
5039 else if (arg.indexOf("batch")!=-1)
5040 state = Interpreter.isBatchMode();
5041 else if (arg.indexOf("applet")!=-1)
5042 state = IJ.getApplet()!=null;
5043 else if (arg.indexOf("virtual")!=-1)
5044 state = getImage().getStack().isVirtual();
5045 else if (arg.indexOf("composite")!=-1)
5046 state = getImage().isComposite();
5047 else if (arg.indexOf("caps")!=-1)
5048 state = getCapsLockState();
5049 else if (arg.indexOf("change")!=-1)
5050 state = getImage().changes;
5051 else if (arg.indexOf("binary")!=-1)
5052 state = getProcessor().isBinary();
5053 else if (arg.indexOf("grayscale")!=-1)
5054 state = getProcessor().isGrayscale();
5055 else if (arg.startsWith("global"))
5056 state = ImagePlus.getStaticGlobalCalibration()!=null;
5057 else if (arg.indexOf("animated")!=-1) {
5058 ImageWindow win = getImage().getWindow();
5059 state = win!=null && (win instanceof StackWindow) && ((StackWindow)win).getAnimate();
5060 } else if (arg.equals("inverty")) {
5061 state = getImage().getCalibration().getInvertY();
5062 } else if (arg.startsWith("area")) {
5063 Roi roi = getImage().getRoi();
5064 state = roi!=null?roi.isArea():false;
5065 } else if (arg.startsWith("line")) {
5066 Roi roi = getImage().getRoi();
5067 state = roi!=null?roi.isLine():false;
5068 } else if (arg.startsWith("fft")) {
5069 state = getImage().getProperty("FHT")!=null;
5070 } else
5071 interp.error("Invalid argument");
5072 return state?1.0:0.0;
5073 }
5074
5075 final boolean getCapsLockState() {
5076 boolean capsDown = false;

Callers 1

getFunctionValueMethod · 0.95

Calls 15

getStringArgMethod · 0.95
getImageMethod · 0.95
isBatchModeMethod · 0.95
getAppletMethod · 0.95
getCapsLockStateMethod · 0.95
getProcessorMethod · 0.95
isAreaMethod · 0.95
isLineMethod · 0.95
isCompositeMethod · 0.80
startsWithMethod · 0.80
getAnimateMethod · 0.80

Tested by

no test coverage detected