public LUT getChannelLut(int channel) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (channel<1 || channel>lut.length) throw new IllegalArgumentException("Channel out of range: "+channel); return lut[channel-1]; }
public LUT getChannelLut(int channel) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (channel<1 || channel>lut.length) throw new IllegalArgumentException("Channel out of range: "+channel); return lut[channel-1]; }
public void setLuts(LUT[] luts) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (luts==null || luts.length<channels) throw new IllegalArgumentException("Lut array is null or too small"); for (int i=0; i<channels; i++) setChannelLut(luts[i], i+1); }
public void setLuts(LUT[] luts) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (luts==null || luts.length<channels) throw new IllegalArgumentException("Lut array is null or too small"); for (int i=0; i<channels; i++) setChannelLut(luts[i], i+1); }
public LUT[] getLuts() { int channels = getNChannels(); if (lut==null) setupLuts(channels); LUT[] luts = new LUT[channels]; for (int i=0; i<channels; i++) luts[i] = (LUT)lut[i].clone(); return luts; }
int getChannelIndex() { int channels = getNChannels(); if (lut==null) setupLuts(channels); int index = getChannel()-1; return index; }
public LUT[] getLuts() { int channels = getNChannels(); if (lut==null) setupLuts(channels); LUT[] luts = new LUT[channels]; for (int i=0; i<channels; i++) luts[i] = (LUT)lut[i].clone(); return luts; }
int getChannelIndex() { int channels = getNChannels(); if (lut==null) setupLuts(channels); int index = getChannel()-1; return index; }
/** * For each channel in CompositeImage, sets LUT to one from given ColorTables */ private void setCompositeImageLUTs(final CompositeImage ci, final List<ColorTable> cTables) { if (cTables == null || cTables.size() == 0) { setCompositeImageLUTsToDefault(ci); } else { for (int i = 0; i < ci.getNChannels(); i++) { final ColorTable cTable = cTables.get(i); final LUT lut = make8BitLUT(cTable); ci.setChannelLut(lut, i + 1); } } }
/** * For each channel in CompositeImage, sets LUT to one from default * progression */ private void setCompositeImageLUTsToDefault(final CompositeImage ci) { for (int i = 0; i < ci.getNChannels(); i++) { final ColorTable cTable = ColorTables.getDefaultColorTable(i); final LUT lut = make8BitLUT(cTable); ci.setChannelLut(lut, i + 1); } }
public void reset() { int nChannels = getNChannels(); if (nChannels>MAX_CHANNELS && getMode()==COMPOSITE) setMode(COLOR); setup(nChannels, getImageStack()); }
public void reset() { int nChannels = getNChannels(); if (nChannels>MAX_CHANNELS && getMode()==COMPOSITE) setMode(COLOR); setup(nChannels, getImageStack()); }
public synchronized void setChannelLut(LUT table, int channel) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (channel<1 || channel>lut.length) throw new IllegalArgumentException("Channel out of range"); lut[channel-1] = (LUT)table.clone(); if (getWindow()!=null && channel==getChannel()) getProcessor().setLut(lut[channel-1]); if (cip!=null && cip.length>=channel && cip[channel-1]!=null) cip[channel-1].setLut(lut[channel-1]); else cip = null; customLuts = true; }
public synchronized void setChannelLut(LUT table, int channel) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (channel<1 || channel>lut.length) throw new IllegalArgumentException("Channel out of range"); lut[channel-1] = (LUT)table.clone(); if (getWindow()!=null && channel==getChannel()) getProcessor().setLut(lut[channel-1]); if (cip!=null && cip.length>=channel && cip[channel-1]!=null) cip[channel-1].setLut(lut[channel-1]); else cip = null; customLuts = true; }
public void resetDisplayRanges() { int channels = getNChannels(); if (lut==null) setupLuts(channels); ImageStack stack2 = getImageStack(); if (lut==null || channels!=lut.length || channels>stack2.getSize() || channels>MAX_CHANNELS) return; for (int i=0; i<channels; ++i) { ImageProcessor ip2 = stack2.getProcessor(i+1); ip2.resetMinAndMax(); lut[i].min = ip2.getMin(); lut[i].max = ip2.getMax(); } }
public void resetDisplayRange() { if (getType()==GRAY16 && getDefault16bitRange()!=0) { int defaultRange = getDefault16bitRange(); for (int i=1; i<=getNChannels(); i++) { LUT lut = getChannelLut(i); lut.min = 0; lut.max = Math.pow(2,defaultRange)-1; if (getWindow()!=null) setChannelLut(lut, i); } } else { ip.resetMinAndMax(); int c = getChannelIndex(); lut[c].min = ip.getMin(); lut[c].max = ip.getMax(); } }
public void resetDisplayRanges() { int channels = getNChannels(); if (lut==null) setupLuts(channels); ImageStack stack2 = getImageStack(); if (lut==null || channels!=lut.length || channels>stack2.getSize() || channels>MAX_CHANNELS) return; for (int i=0; i<channels; ++i) { ImageProcessor ip2 = stack2.getProcessor(i+1); ip2.resetMinAndMax(); lut[i].min = ip2.getMin(); lut[i].max = ip2.getMax(); } }
public void resetDisplayRange() { if (getType()==GRAY16 && getDefault16bitRange()!=0) { int defaultRange = getDefault16bitRange(); for (int i=1; i<=getNChannels(); i++) { LUT lut = getChannelLut(i); lut.min = 0; lut.max = Math.pow(2,defaultRange)-1; if (getWindow()!=null) setChannelLut(lut, i); } } else { ip.resetMinAndMax(); int c = getChannelIndex(); lut[c].min = ip.getMin(); lut[c].max = ip.getMax(); } }
public ThumbnailsCanvas(ImagePlus imp) { if (!imp.isComposite()) { return; } cImp = (CompositeImage) imp; addMouseListener(this); addMouseMotionListener(this); currentChannel = cImp.getChannel(); currentSlice = cImp.getSlice(); currentFrame = cImp.getFrame(); channelUnderCursor = currentChannel; int ww = cImp.getWidth(); int hh = cImp.getHeight(); if (ww > hh) { iconHeight = iconWidth * hh / ww; dy = (iconWidth - iconHeight) / 2; } if (ww < hh) { iconWidth = iconHeight * ww / hh; dx = (iconHeight - iconWidth) / 2; } nChannels = cImp.getNChannels(); seq = seq.substring(0, nChannels); setSize((nChannels + 1) * iconSize, 2 * iconSize + 30); }
protected void transferChannelSettings( final CompositeImage ci, final SetupAssignments setupAssignments, final VisibilityAndGrouping visibility ) { final int nChannels = ci.getNChannels(); final int mode = ci.getCompositeMode(); final boolean transferColor = mode == IJ.COMPOSITE || mode == IJ.COLOR; for ( int c = 0; c < nChannels; ++c ) { final LUT lut = ci.getChannelLut( c + 1 ); final ConverterSetup setup = setupAssignments.getConverterSetups().get( c ); if ( transferColor ) setup.setColor( new ARGBType( lut.getRGB( 255 ) ) ); setup.setDisplayRange( lut.min, lut.max ); } if ( mode == IJ.COMPOSITE ) { final boolean[] activeChannels = ci.getActiveChannels(); visibility.setDisplayMode( DisplayMode.FUSED ); for ( int i = 0; i < activeChannels.length; ++i ) visibility.setSourceActive( i, activeChannels[ i ] ); } else visibility.setDisplayMode( DisplayMode.SINGLE ); visibility.setCurrentSource( ci.getChannel() - 1 ); }