Package inra.ijpb.plugins
Class InteractiveMarkerControlledWatershed
java.lang.Object
inra.ijpb.plugins.InteractiveMarkerControlledWatershed
- All Implemented Interfaces:
ij.plugin.PlugIn
public class InteractiveMarkerControlledWatershed
extends java.lang.Object
implements ij.plugin.PlugIn
Plugin to perform automatic segmentation of 2D and 3D images
using marker-controlled watershed with manually selected seeds.
References:
[1] Soille, P., Morphological Image Analysis: Principles and
Applications, Springer-Verlag, 1999, pp. 170-171.
- Author:
- Ignacio Arganda-Carreras
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InteractiveMarkerControlledWatershed.ResultMode
enumeration of result modes -
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CREATE_IMAGE
name of the macro method to show current segmentation result in a new windowstatic java.lang.String
MERGE_LABELS
name of the macro method to merge selected labelsstatic java.lang.String
RUN_SEGMENTATION
name of the macro method to segment the current image based on the current parametersstatic java.lang.String
SET_DISPLAY
name of the macro method to set the output display formatstatic java.lang.String
SET_INPUT_TYPE
name of the macro method to set the input image typestatic java.lang.String
SET_RADIUS
name of the macro method to set the gradient radiusstatic java.lang.String
SHOW_GRADIENT
name of the macro method to set the flag to show the gradient imagestatic java.lang.String
SHOW_RESULT_OVERLAY
name of the macro method to toggle the current overlaystatic java.lang.String
SHUFFLE_COLORS
name of the macro method to shuffle color labels -
Constructor Summary
Constructors Constructor Description InteractiveMarkerControlledWatershed()
-
Method Summary
Modifier and Type Method Description static void
createResultImage()
Show current result in a new imagestatic void
mergeLabels()
Merge labels that are selected either by a freehand or a point ROI.static void
record(java.lang.String command, java.lang.String... args)
Macro-record a specific command.void
run(java.lang.String arg0)
static void
segment(java.lang.String calculateDams, java.lang.String compactness, java.lang.String connectivity)
Segment current image (GUI needs to be running)static void
setDisplayFormat(java.lang.String format)
Set the display format in the GUIstatic void
shuffleColors()
Shuffle LUT of current display image.static void
toggleOverlay()
Toggle current result overlay imageMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
RUN_SEGMENTATION
public static java.lang.String RUN_SEGMENTATIONname of the macro method to segment the current image based on the current parameters -
SHOW_RESULT_OVERLAY
public static java.lang.String SHOW_RESULT_OVERLAYname of the macro method to toggle the current overlay -
CREATE_IMAGE
public static java.lang.String CREATE_IMAGEname of the macro method to show current segmentation result in a new window -
SET_INPUT_TYPE
public static java.lang.String SET_INPUT_TYPEname of the macro method to set the input image type -
SHOW_GRADIENT
public static java.lang.String SHOW_GRADIENTname of the macro method to set the flag to show the gradient image -
SET_DISPLAY
public static java.lang.String SET_DISPLAYname of the macro method to set the output display format -
SET_RADIUS
public static java.lang.String SET_RADIUSname of the macro method to set the gradient radius -
MERGE_LABELS
public static java.lang.String MERGE_LABELSname of the macro method to merge selected labels -
SHUFFLE_COLORS
public static java.lang.String SHUFFLE_COLORSname of the macro method to shuffle color labels
-
-
Constructor Details
-
InteractiveMarkerControlledWatershed
public InteractiveMarkerControlledWatershed()
-
-
Method Details
-
run
public void run(java.lang.String arg0)- Specified by:
run
in interfaceij.plugin.PlugIn
-
record
public static void record(java.lang.String command, java.lang.String... args)Macro-record a specific command. The command names match the static methods that reproduce that part of the code.- Parameters:
command
- name of the command including package infoargs
- set of arguments for the command
-
segment
public static void segment(java.lang.String calculateDams, java.lang.String compactness, java.lang.String connectivity)Segment current image (GUI needs to be running)- Parameters:
calculateDams
- string containing boolean flag to create dams (format: "calculateDams=[boolean])compactness
- compactness constrain parameter (values larger than 0 imply using compact watershed)connectivity
- string containing connectivity value (format: "connectivity=[4 or 8 / 6 or 26])
-
toggleOverlay
public static void toggleOverlay()Toggle current result overlay image -
mergeLabels
public static void mergeLabels()Merge labels that are selected either by a freehand or a point ROI. Label of value 0 (watershed line) is skipped. -
shuffleColors
public static void shuffleColors()Shuffle LUT of current display image. -
createResultImage
public static void createResultImage()Show current result in a new image -
setDisplayFormat
public static void setDisplayFormat(java.lang.String format)Set the display format in the GUI- Parameters:
format
- output mode ("Overlaid basins", "Overlaid dams", "Catchment basins", "Watershed lines")
-