Refine search
public void storeChannelProperties(final int channel) { checkChannel(channel); final ChannelDisplayProperties props = chDisplayProps[channel - 1]; final ImageProcessor channelIP = channelIPs[channel - 1]; // Display properties if (!props.isDisplayedGray() && !displayAllGray) { props.setColorModel(channelIP.getColorModel()); } props.setMinValue(channelIP.getMin()); props.setMaxValue(channelIP.getMax()); props.setMinThreshold(channelIP.getMinThreshold()); props.setMaxThreshold(channelIP.getMaxThreshold()); props.setLutUpdateMode(channelIP.getLutUpdateMode()); // TODO: handling of calibration function? }
private int computeSliderRange() { double defaultMin = initial.getMin(); double defaultMax = initial.getMax(); int valueRange = (int)(defaultMax - defaultMin); int newSliderRange = valueRange; if (newSliderRange>640 && newSliderRange<1280) { newSliderRange /= 2; } else if (newSliderRange>=1280) { newSliderRange /= 5; } if (newSliderRange < 256) newSliderRange = 256; if (newSliderRange > 1024) newSliderRange = 1024; return newSliderRange; }
/** Scales a threshold level to the range 0-255. */ double scaleDown(ImageProcessor ip, double threshold) { if (ip instanceof ByteProcessor) return threshold; double min = ip.getMin(); double max = ip.getMax(); if (max>min) { double scaledThr = ((threshold-min)/(max-min))*255.0; if (scaledThr < 0.0) scaledThr = 0.0; if (scaledThr > 255.0) scaledThr = 255.0; return scaledThr; } else return ImageProcessor.NO_THRESHOLD; }
/** Scales a threshold level to the range 0-255. */ double scaleDown(ImageProcessor ip, double threshold) { if (ip instanceof ByteProcessor) return threshold; double min = ip.getMin(); double max = ip.getMax(); if (max>min) { double scaledThr = ((threshold-min)/(max-min))*255.0; if (scaledThr < 0.0) scaledThr = 0.0; if (scaledThr > 255.0) scaledThr = 255.0; return scaledThr; } else return ImageProcessor.NO_THRESHOLD; }
/** * Apply fast watersheds using flooding simulations, as described * by Soille, Pierre, and Luc M. Vincent. "Determining watersheds * in digital pictures via flooding simulations." Lausanne-DL * tentative. International Society for Optics and Photonics, 1990. * * @return image of labeled catchment basins (with dams) */ public ImageProcessor apply() { return apply( inputImage.getMin(), inputImage.getMax() ); }
/** * Apply fast watersheds using flooding simulations, as described * by Soille, Pierre, and Luc M. Vincent. "Determining watersheds * in digital pictures via flooding simulations." Lausanne-DL * tentative. International Society for Optics and Photonics, 1990. * * @return image of labeled catchment basins (with dams) */ private ImageProcessor applyWithoutMask() { return applyWithoutMask( inputImage.getMin(), inputImage.getMax() ); }
/** * Apply fast watersheds using flooding simulations, as described * by Soille, Pierre, and Luc M. Vincent. "Determining watersheds * in digital pictures via flooding simulations." Lausanne-DL * tentative. International Society for Optics and Photonics, 1990. * * @return image of labeled catchment basins (with dams) */ public ImageProcessor apply() { return apply( inputImage.getMin(), inputImage.getMax() ); }
/** * Apply fast watersheds using flooding simulations, as described * by Soille, Pierre, and Luc M. Vincent. "Determining watersheds * in digital pictures via flooding simulations." Lausanne-DL * tentative. International Society for Optics and Photonics, 1990. * This implementation restricts the watershed to the regions in * white in the binary mask. * NOTE: this algorithm may have plateaus in the dams. * * @return image of labeled catchment basins (with dams) */ private ImageProcessor applyWithMask() { return applyWithMask( inputImage.getMin(), inputImage.getMax() ); }
/** Specifies whether or not text is drawn using antialiasing. Antialiased test requires an 8 bit or RGB image. Antialiasing does not work with 8-bit images that are not using 0-255 display range. */ public void setAntialiasedText(boolean antialiasedText) { setupFontMetrics(); if (antialiasedText && (((this instanceof ByteProcessor)&&getMin()==0.0&&getMax()==255.0) || (this instanceof ColorProcessor))) this.antialiasedText = true; else this.antialiasedText = false; Java2.setAntialiasedText(fmGraphics, this.antialiasedText); fontMetrics = fmGraphics.getFontMetrics(font); }
/** Specifies whether or not text is drawn using antialiasing. Antialiased test requires an 8 bit or RGB image. Antialiasing does not work with 8-bit images that are not using 0-255 display range. */ public void setAntialiasedText(boolean antialiasedText) { setupFontMetrics(); if (antialiasedText && (((this instanceof ByteProcessor)&&getMin()==0.0&&getMax()==255.0) || (this instanceof ColorProcessor))) this.antialiasedText = true; else this.antialiasedText = false; Java2.setAntialiasedText(fmGraphics, this.antialiasedText); fontMetrics = fmGraphics.getFontMetrics(font); }