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

Method setActiveChannels

ij/src/main/java/ij/ImagePlus.java:442–454  ·  view source on GitHub ↗

Controls which channels in a composite color image are displayed, where 'channels' is a list of ones and zeros that specify the channels to display. For example, "101" causes channels 1 and 3 to be displayed.

(String channels)

Source from the content-addressed store, hash-verified

440 where 'channels' is a list of ones and zeros that specify the channels to
441 display. For example, "101" causes channels 1 and 3 to be displayed. */
442 public void setActiveChannels(String channels) {
443 if (!(this instanceof CompositeImage))
444 return;
445 boolean[] active = ((CompositeImage)this).getActiveChannels();
446 for (int i=0; i<active.length; i++) {
447 boolean b = false;
448 if (channels.length()>i && channels.charAt(i)=='1')
449 b = true;
450 active[i] = b;
451 }
452 updateAndDraw();
453 Channels.updateChannels();
454 }
455
456 /** Updates this image from the pixel data in its
457 associated ImageProcessor, then displays it.

Callers 1

doStackMethod · 0.95

Calls 5

updateAndDrawMethod · 0.95
updateChannelsMethod · 0.95
charAtMethod · 0.80
lengthMethod · 0.65
getActiveChannelsMethod · 0.45

Tested by

no test coverage detected