/** * Copies the LUTs and display mode of 'imp' to this image. Does nothing if 'imp' is not a * CompositeImage or 'imp' and this image do not have the same number of channels. */ public synchronized void copyLuts(ImagePlus imp) { int channels = getNChannels(); if (!imp.isComposite() || imp.getNChannels() != channels) return; CompositeImage ci = (CompositeImage) imp; LUT[] luts = ci.getLuts(); if (luts != null && luts.length == channels) { lut = luts; cip = null; } int mode2 = ci.getMode(); setMode(mode2); if (mode2 == COMPOSITE) { boolean[] active2 = ci.getActiveChannels(); for (int i = 0; i < MAX_CHANNELS; i++) active[i] = active2[i]; } if (ci.hasCustomLuts()) customLuts = true; }