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

Method toggleChannel

ij/src/main/java/ij/macro/Functions.java:5705–5716  ·  view source on GitHub ↗
(ImagePlus imp, int channel)

Source from the content-addressed store, hash-verified

5703 }
5704
5705 void toggleChannel(ImagePlus imp, int channel) {
5706 if (!imp.isComposite())
5707 interp.error("Composite image required");
5708 if (channel<1 || channel>imp.getNChannels())
5709 interp.error("Invalid channel: "+channel);
5710 if (((CompositeImage)imp).getMode()!=IJ.COMPOSITE)
5711 ((CompositeImage)imp).setMode(IJ.COMPOSITE);
5712 boolean[] active = ((CompositeImage)imp).getActiveChannels();
5713 active[channel-1] = active[channel-1]?false:true;
5714 imp.updateAndDraw();
5715 Channels.updateChannels();
5716 }
5717
5718 void setDisplayMode(ImagePlus imp, String mode) {
5719 mode = mode.toLowerCase(Locale.US);

Callers 1

doStackMethod · 0.95

Calls 8

updateChannelsMethod · 0.95
isCompositeMethod · 0.80
errorMethod · 0.45
getNChannelsMethod · 0.45
getModeMethod · 0.45
setModeMethod · 0.45
getActiveChannelsMethod · 0.45
updateAndDrawMethod · 0.45

Tested by

no test coverage detected