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

Method setDisplayMode

ij/src/main/java/ij/macro/Functions.java:5718–5733  ·  view source on GitHub ↗
(ImagePlus imp, String mode)

Source from the content-addressed store, hash-verified

5716 }
5717
5718 void setDisplayMode(ImagePlus imp, String mode) {
5719 mode = mode.toLowerCase(Locale.US);
5720 if (!imp.isComposite())
5721 interp.error("Composite image required");
5722 int m = -1;
5723 if (mode.equals("composite"))
5724 m = IJ.COMPOSITE;
5725 else if (mode.equals("color"))
5726 m = IJ.COLOR;
5727 else if (mode.startsWith("gray"))
5728 m = IJ.GRAYSCALE;
5729 if (m==-1)
5730 interp.error("Invalid mode");
5731 ((CompositeImage)imp).setMode(m);
5732 imp.updateAndDraw();
5733 }
5734
5735 void swapStackImages(ImagePlus imp) {
5736 int n1 = (int)getFirstArg();

Callers 4

doStackMethod · 0.95
runMethod · 0.45
runMethod · 0.45

Calls 6

isCompositeMethod · 0.80
startsWithMethod · 0.80
errorMethod · 0.45
equalsMethod · 0.45
setModeMethod · 0.45
updateAndDrawMethod · 0.45

Tested by

no test coverage detected