public class MaximumFinder extends java.lang.Object implements ExtendedPlugInFilter, DialogListener
| Modifier and Type | Field and Description |
|---|---|
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 |
LIST
Do not create an image, just list x, y of maxima in the Results table
|
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
|
KEEP_PREVIEWCONVERT_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 and Description |
|---|
MaximumFinder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
dialogItemChanged(GenericDialog gd,
java.awt.AWTEvent e)
Read the parameters (during preview or after showing the dialog)
|
static int[] |
findMaxima(double[] xx,
double tolerance,
boolean excludeOnEdges)
Calculates peak positions of 1D array N.Vischer, 13-sep-2013
|
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).
|
ByteProcessor |
findMaxima(ImageProcessor ip,
double tolerance,
int outputType,
boolean excludeOnEdges)
Find the maxima of an image.
|
static int[] |
findMinima(double[] xx,
double tolerance,
boolean includeEdges)
Returns minimum positions of array xx, sorted with decreasing strength
|
java.awt.Polygon |
getMaxima(ImageProcessor ip,
double tolerance,
boolean excludeOnEdges)
Finds the image maxima and returns them as a Polygon.
|
void |
run(ImageProcessor ip)
The plugin is inferred from ImageJ by this method
|
void |
setNPasses(int nPasses)
Set his to the number of images to process (for the watershed progress bar only).
|
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. |
public static final int SINGLE_POINTS
public static final int IN_TOLERANCE
public static final int SEGMENTED
public static final int POINT_SELECTION
public static final int LIST
public static final int COUNT
public int setup(java.lang.String arg,
ImagePlus imp)
setup in interface PlugInFilterarg - Not used by this plugin-filterimp - The image to be filteredpublic int showDialog(ImagePlus imp, java.lang.String command, PlugInFilterRunner pfr)
ExtendedPlugInFiltersetup(arg, imp) unless the
DONE flag has been set.showDialog in interface ExtendedPlugInFilterimp - 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).PlugInFilter and
ExtendedPlugInFilter.public boolean dialogItemChanged(GenericDialog gd, java.awt.AWTEvent e)
dialogItemChanged in interface DialogListenergd - A reference to the GenericDialog.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.public void setNPasses(int nPasses)
setNPasses in interface ExtendedPlugInFilterpublic void run(ImageProcessor ip)
run in interface PlugInFilterip - The image where maxima (or minima) should be foundpublic java.awt.Polygon getMaxima(ImageProcessor ip, double tolerance, boolean excludeOnEdges)
ip - The input imagetolerance - Height tolerance: maxima are accepted only if protruding more than this value
from the ridge to a higher maximumexcludeOnEdges - Whether to exclude edge maximapublic static int[] findMaxima(double[] xx,
double tolerance,
boolean excludeOnEdges)
xx - Array containing peaks.tolerance - Depth of a qualified valley must exceed tolerance.
Tolerance must be >= 0. Flat tops are marked at their centers.excludeOnEdges - If 'true', a peak is only
accepted if it is separated by two qualified valleys. If 'false', a peak
is also accepted if separated by one qualified valley and by a border.public static int[] findMinima(double[] xx,
double tolerance,
boolean includeEdges)
public ByteProcessor findMaxima(ImageProcessor ip, double tolerance, int outputType, boolean excludeOnEdges)
ip - The input imagetolerance - Height tolerance: maxima are accepted only if protruding more than this value
from the ridge to a higher maximumoutputType - What to mark in output image: SINGLE_POINTS, IN_TOLERANCE or SEGMENTED.
No output image is created for output types POINT_SELECTION, LIST and COUNT.excludeOnEdges - Whether to exclude edge maximapublic ByteProcessor findMaxima(ImageProcessor ip, double tolerance, double threshold, int outputType, boolean excludeOnEdges, boolean isEDM)
ip - The input imagetolerance - Height tolerance: maxima are accepted only if protruding more than this value
from the ridge to a higher maximumthreshold - minimum height of a maximum (uncalibrated); for no minimum height set it to
ImageProcessor.NO_THRESHOLDoutputType - What to mark in output image: SINGLE_POINTS, IN_TOLERANCE or SEGMENTED.
No output image is created for output types POINT_SELECTION, LIST and COUNT.excludeOnEdges - Whether to exclude edge maximaisEDM - Whether the image is a float Euclidian Distance Map.