Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ij.plugin.filter
Class MaximumFinder

    java.lang.Object
      ij.plugin.filter.MaximumFinder

All Implemented Interfaces:
  DialogListener, ExtendedPlugInFilter, PlugInFilter

public class MaximumFinder
extends java.lang.Object
implements ExtendedPlugInFilter, DialogListener

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. version 28-May-2007 Michael Schmid. Preview added, bugfix: minima of calibrated images, uses Arrays.sort (Java2 required)

Field Summary
`static int` | `COUNT` Do not create an image, just count maxima and add count to Results table
`static int` | `IN_TOLERANCE` Output type all points around the maximum within the tolerance
`static int` | `POINT_SELECTION` Do not create image, only mark points
`static int` | `SEGMENTED` Output type watershed-segmented image
`static int` | `SINGLE_POINTS` Output type single points

Fields inherited from interface ij.plugin.filter.ExtendedPlugInFilter
`KEEP_PREVIEW`

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, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING`

Constructor Summary
`MaximumFinder()`

Method Summary
`boolean` | `dialogItemChanged(GenericDialog gd, java.awt.AWTEvent e)` Read the parameters (during preview or after showing the dialog)
`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 (does not find minima)
`void` | `run(ImageProcessor ip)` The plugin is inferred from ImageJ by this method
`void` | `setNPasses(int nPasses)` unused method required by interface ExtendedPlugInFilter
`int` | `setup(java.lang.String arg, ImagePlus imp)` Method to return types supported
`int` | `showDialog(ImagePlus imp, java.lang.String command, PlugInFilterRunner pfr)` This method is called after `setup(arg, imp)` unless the `DONE` flag has been set.

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

### 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

### POINT_SELECTION

    public static final int POINT_SELECTION

  Do not create image, only mark points

  See Also:
    Constant Field Values

### COUNT

    public static final int COUNT

  Do not create an image, just count maxima and add count to Results table

  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

  Specified by:
    `setup` in interface `PlugInFilter`
  Parameters:
    `arg` - Not used by this plugin-filter
    `imp` - The image to be filtered
  Returns:
    Code describing supported formats etc. (see ij.plugin.filter.PlugInFilter & ExtendedPlugInFilter)

### showDialog

    public int showDialog(ImagePlus imp,
                          java.lang.String command,
                          PlugInFilterRunner pfr)

  Description copied from interface: `ExtendedPlugInFilter`
  This method is called after `setup(arg, imp)` unless the `DONE` flag has been set.

  Specified by:
    `showDialog` in interface `ExtendedPlugInFilter`
  Parameters:
    `imp` - The active image already passed in the `setup(arg, imp)` call. It will be null, however, if the `NO_IMAGE_REQUIRED` flag has been set.
    `command` - The command that has led to the invocation of the plugin-filter. Useful as a title for the dialog.
    `pfr` - The PlugInFilterRunner calling this plugin-filter. It can be passed to a GenericDialog by `addPreviewCheckbox` to enable preview by calling the `run(ip)` method of this plugin-filter. `pfr` can be also used later for calling back the PlugInFilterRunner, e.g., to obtain the slice number currently processed by `run(ip)`.
  Returns:
    The method should return a combination (bitwise OR) of the flags specified in interfaces `PlugInFilter` and `ExtendedPlugInFilter`.

### dialogItemChanged

    public boolean dialogItemChanged(GenericDialog gd,
                                     java.awt.AWTEvent e)

  Read the parameters (during preview or after showing the dialog)

  Specified by:
    `dialogItemChanged` in interface `DialogListener`
  Parameters:
    `e` - The event that has been generated by the user action in the dialog. Note that `e` is `null` if the dialogItemChanged method is called after the user has pressed the OK button or if the GenericDialog has read its parameters from a macro.
    `gd` - A reference to the GenericDialog.
  Returns:
    Should be true if the dialog input is valid. False disables the OK button and preview (if any).

### setNPasses

    public void setNPasses(int nPasses)

  unused method required by interface ExtendedPlugInFilter

  Specified by:
    `setNPasses` in interface `ExtendedPlugInFilter`

### 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 where maxima (or minima) should be found

### 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 (does not find minima)

  Parameters:
    `ip` - The input image
    `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 outputType does not require an output or if cancelled.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD