ij.plugin.filter
Class MaximumFinder

java.lang.Object
  extended by ij.plugin.filter.MaximumFinder
All Implemented Interfaces:
PlugInFilter

public class MaximumFinder
extends java.lang.Object
implements PlugInFilter

This ImageJ plug-in filter creates a mask where the local maxima of the current image are marked (255; unmarked pixels 0). The plug-in can also create watershed-segmented particles (assume a landscape of inverted heights: maxima of the images are now water sinks. For each point in the image, the sink that the water goes to determines which particle it belongs to. Pixels with a level below the lower threshold can be left unprocessed. This plugin works with ROIs, including non-rectangular ROIs. Since this plug-in creates a separate output image it processes only single images or slices, no stacks. version 09-Nov-2006 Michael Schmid version 21-Nov-2006 Wayne Rasband. Adds "Display Point Selection" option and "Count" output type.


Field Summary
static int COUNT
          Output type no image, only count maxima
static int IN_TOLERANCE
          Output type all points around the maximum within the tolerance
static int MAXIMA_EXACT
          Output type all points at exactly the level of the maximum
static int SEGMENTED
          Output type watershed-segmented image
static int SINGLE_POINTS
          Output type single points
 
Fields inherited from interface ij.plugin.filter.PlugInFilter
DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, ROI_REQUIRED, STACK_REQUIRED, SUPPORTS_MASKING
 
Constructor Summary
MaximumFinder()
           
 
Method Summary
 ByteProcessor findMaxima(ImageProcessor ip, double tolerance, double threshold, int outputType, boolean excludeOnEdges, boolean isEDM)
          Here the processing is done: Find the maxima of an image (8, 16, 32 bit)
 void run(ImageProcessor ip)
          The plugin is inferred from ImageJ by this method
 int setup(java.lang.String arg, ImagePlus imp)
          Method to return types supported and about dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLE_POINTS

public static final int SINGLE_POINTS
Output type single points

See Also:
Constant Field Values

MAXIMA_EXACT

public static final int MAXIMA_EXACT
Output type all points at exactly the level of the maximum

See Also:
Constant Field Values

IN_TOLERANCE

public static final int IN_TOLERANCE
Output type all points around the maximum within the tolerance

See Also:
Constant Field Values

SEGMENTED

public static final int SEGMENTED
Output type watershed-segmented image

See Also:
Constant Field Values

COUNT

public static final int COUNT
Output type no image, only count maxima

See Also:
Constant Field Values
Constructor Detail

MaximumFinder

public MaximumFinder()
Method Detail

setup

public int setup(java.lang.String arg,
                 ImagePlus imp)
Method to return types supported and about dialog

Specified by:
setup in interface PlugInFilter
Parameters:
arg - if "about", displays 'about...' dialog if "again", does filtering with the same parameters again (without asking)
imp - unused
Returns:
Code describing supported formats etc. (see ij.plugin.filter)

run

public void run(ImageProcessor ip)
The plugin is inferred from ImageJ by this method

Specified by:
run in interface PlugInFilter
Parameters:
ip - the image to be filtered)

findMaxima

public ByteProcessor findMaxima(ImageProcessor ip,
                                double tolerance,
                                double threshold,
                                int outputType,
                                boolean excludeOnEdges,
                                boolean isEDM)
Here the processing is done: Find the maxima of an image (8, 16, 32 bit)

Parameters:
ip - The image subject to filtering
tolerance - Height tolerance: maxima are accepted only if protruding more than this value from the ridge to a higher maximum
threshold - minimum height of a maximum (uncalibrated); for no minimum height set it to ImageProcessor.NO_THRESHOLD
outputType - What to mark in output image: SINGLE_POINTS, MAXIMA_EXACT, IN_TOLERANCE or SEGMENTED
excludeOnEdges - Whether to exclude edge maxima
isEDM - Whether the image is a 16-bit Euclidian Distance Map
Returns:
A new byteProcessor with a normal (uninverted) LUT where the marked points are set to 255 (Background 0). Pixels outside of the roi of the input ip are not set. Returns null if cancelled.