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 classInteractiveMarkerControlledWatershed.ResultModeenumeration of result modes -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCREATE_IMAGEname of the macro method to show current segmentation result in a new windowstatic java.lang.StringMERGE_LABELSname of the macro method to merge selected labelsstatic java.lang.StringRUN_SEGMENTATIONname of the macro method to segment the current image based on the current parametersstatic java.lang.StringSET_DISPLAYname of the macro method to set the output display formatstatic java.lang.StringSET_INPUT_TYPEname of the macro method to set the input image typestatic java.lang.StringSET_RADIUSname of the macro method to set the gradient radiusstatic java.lang.StringSHOW_GRADIENTname of the macro method to set the flag to show the gradient imagestatic java.lang.StringSHOW_RESULT_OVERLAYname of the macro method to toggle the current overlaystatic java.lang.StringSHUFFLE_COLORSname of the macro method to shuffle color labels -
Constructor Summary
Constructors Constructor Description InteractiveMarkerControlledWatershed() -
Method Summary
Modifier and Type Method Description static voidcreateResultImage()Show current result in a new imagestatic voidmergeLabels()Merge labels that are selected either by a freehand or a point ROI.static voidrecord(java.lang.String command, java.lang.String... args)Macro-record a specific command.voidrun(java.lang.String arg0)static voidsegment(java.lang.String calculateDams, java.lang.String compactness, java.lang.String connectivity)Segment current image (GUI needs to be running)static voidsetDisplayFormat(java.lang.String format)Set the display format in the GUIstatic voidshuffleColors()Shuffle LUT of current display image.static voidtoggleOverlay()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:
runin 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")
-