mtb_segmentation
Class Threshold_Image

java.lang.Object
  extended by mtb_segmentation.Threshold_Image
All Implemented Interfaces:
ij.gui.DialogListener, ij.plugin.filter.PlugInFilter

public class Threshold_Image
extends java.lang.Object
implements ij.plugin.filter.PlugInFilter, ij.gui.DialogListener

Plugin for thresholding plain images, stacks and hyperstacks. The output image is of the datatype of the input image. The output might contain values different from 0 depending on the image's datatype:
Byte images: Output values are 0 for black and 255 for white, if the 'original pixel values' option was not chosen.
Short images: Output values are 0 for black and the maximum gray value of the input image for white.
Floating point images: Output values are the minimum gray value of the input image for black and the maximum gray value for white.

Author:
gress

Field Summary
private  double black
          black value for current image
private  boolean currentSliceOnly
          flag if only current slice is to be thresholded
private  double m_bg
          background pixel value
private  double m_fg
          foreground pixel value
private  MTBImage m_img
          image to threshold
private  ij.ImagePlus m_imgPlus
          original ImagePlus
private  double m_thresh
          threshold
private  MTBImage m_threshImg
          thresholded image
private  double[] minmax_img
          min and max gray value of the current image
private  double white
          white value for current image
 
Fields inherited from interface ij.plugin.filter.PlugInFilter
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, KEEP_THRESHOLD, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, PARALLELIZE_IMAGES, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING
 
Constructor Summary
Threshold_Image()
           
 
Method Summary
 boolean dialogItemChanged(ij.gui.GenericDialog gd, java.awt.AWTEvent e)
           
 void run(ij.process.ImageProcessor ip)
           
 int setup(java.lang.String arg, ij.ImagePlus imp)
           
private  boolean thresholdSetupDialog()
          Dialog for choosing thresholding parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

black

private double black
black value for current image


currentSliceOnly

private boolean currentSliceOnly
flag if only current slice is to be thresholded


m_bg

private double m_bg
background pixel value


m_fg

private double m_fg
foreground pixel value


m_img

private MTBImage m_img
image to threshold


m_imgPlus

private ij.ImagePlus m_imgPlus
original ImagePlus


m_thresh

private double m_thresh
threshold


m_threshImg

private MTBImage m_threshImg
thresholded image


minmax_img

private double[] minmax_img
min and max gray value of the current image


white

private double white
white value for current image

Constructor Detail

Threshold_Image

public Threshold_Image()
Method Detail

dialogItemChanged

public boolean dialogItemChanged(ij.gui.GenericDialog gd,
                                 java.awt.AWTEvent e)
Specified by:
dialogItemChanged in interface ij.gui.DialogListener

run

public void run(ij.process.ImageProcessor ip)
Specified by:
run in interface ij.plugin.filter.PlugInFilter

setup

public int setup(java.lang.String arg,
                 ij.ImagePlus imp)
Specified by:
setup in interface ij.plugin.filter.PlugInFilter

thresholdSetupDialog

private boolean thresholdSetupDialog()
Dialog for choosing thresholding parameters

Returns:
true if the dialog was terminated by OK-button, false in any other case