Package inra.ijpb.plugins
Class MorphologicalSegmentation
java.lang.Object
inra.ijpb.plugins.MorphologicalSegmentation
- All Implemented Interfaces:
- ij.plugin.PlugIn
public class MorphologicalSegmentation
extends java.lang.Object
implements ij.plugin.PlugIn
Plugin to perform automatic segmentation of 2D and 3D images 
 based on morphological operations, mainly extended minima
 and watershed transforms.
 
 References:
 [1] Soille, P., Morphological Image Analysis: Principles and
     Applications, Springer-Verlag, 1999, pp. 170-171.
- Author:
- Ignacio Arganda-Carreras
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classMorphologicalSegmentation.ResultModeenumeration of result modes
- 
Field SummaryFields 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_GRADIENT_TYPEname of the macro method to set the gradient methodstatic 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 SummaryConstructors Constructor Description MorphologicalSegmentation()
- 
Method SummaryModifier 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 dynamic, java.lang.String calculateDams, java.lang.String connectivity)Segment current image (GUI needs to be running)static voidsegment(java.lang.String dynamic, java.lang.String calculateDams, java.lang.String connectivity, java.lang.String usePriorityQueue)Deprecated.the priority queue method is now the only onestatic voidsetDisplayFormat(java.lang.String format)Set the display format in the GUIstatic voidsetGradientRadius(java.lang.String radius)Set the gradient radiusstatic voidsetGradientType(java.lang.String method)Set the gradient method to usestatic voidsetInputImageType(java.lang.String type)Set input image typestatic voidsetShowGradient(java.lang.String bool)Set GUI to show gradient image in the main canvasstatic voidshuffleColors()Shuffle LUT of current display image.static voidtoggleOverlay()Toggle current result overlay imageMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Field Details- 
RUN_SEGMENTATIONpublic static java.lang.String RUN_SEGMENTATIONname of the macro method to segment the current image based on the current parameters
- 
SHOW_RESULT_OVERLAYpublic static java.lang.String SHOW_RESULT_OVERLAYname of the macro method to toggle the current overlay
- 
CREATE_IMAGEpublic static java.lang.String CREATE_IMAGEname of the macro method to show current segmentation result in a new window
- 
SET_INPUT_TYPEpublic static java.lang.String SET_INPUT_TYPEname of the macro method to set the input image type
- 
SHOW_GRADIENTpublic static java.lang.String SHOW_GRADIENTname of the macro method to set the flag to show the gradient image
- 
SET_DISPLAYpublic static java.lang.String SET_DISPLAYname of the macro method to set the output display format
- 
SET_RADIUSpublic static java.lang.String SET_RADIUSname of the macro method to set the gradient radius
- 
SET_GRADIENT_TYPEpublic static java.lang.String SET_GRADIENT_TYPEname of the macro method to set the gradient method
- 
MERGE_LABELSpublic static java.lang.String MERGE_LABELSname of the macro method to merge selected labels
- 
SHUFFLE_COLORSpublic static java.lang.String SHUFFLE_COLORSname of the macro method to shuffle color labels
 
- 
- 
Constructor Details- 
MorphologicalSegmentationpublic MorphologicalSegmentation()
 
- 
- 
Method Details- 
runpublic void run(java.lang.String arg0)- Specified by:
- runin interface- ij.plugin.PlugIn
 
- 
recordpublic 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 info
- args- set of arguments for the command
 
- 
segmentpublic static void segment(java.lang.String dynamic, java.lang.String calculateDams, java.lang.String connectivity, java.lang.String usePriorityQueue)Deprecated.the priority queue method is now the only oneSegment current image (GUI needs to be running)- Parameters:
- dynamic- string containing dynamic value (format: "dynamic=[integer value]")
- calculateDams- string containing boolean flag to create dams (format: "calculateDams=[boolean])
- connectivity- string containing connectivity value (format: "connectivity=[4 or 8 / 6 or 26])
- usePriorityQueue- string containing boolean flag to use priority queue (format: "usePriorityQueue=[boolean])
 
- 
segmentpublic static void segment(java.lang.String dynamic, java.lang.String calculateDams, java.lang.String connectivity)Segment current image (GUI needs to be running)- Parameters:
- dynamic- string containing dynamic value (format: "dynamic=[integer value]")
- calculateDams- string containing boolean flag to create dams (format: "calculateDams=[boolean])
- connectivity- string containing connectivity value (format: "connectivity=[4 or 8 / 6 or 26])
 
- 
toggleOverlaypublic static void toggleOverlay()Toggle current result overlay image
- 
mergeLabelspublic static void mergeLabels()Merge labels that are selected either by a freehand or a point ROI. Label of value 0 (watershed line) is skipped.
- 
shuffleColorspublic static void shuffleColors()Shuffle LUT of current display image.
- 
createResultImagepublic static void createResultImage()Show current result in a new image
- 
setInputImageTypepublic static void setInputImageType(java.lang.String type)Set input image type- Parameters:
- type- input image type (border or object)
 
- 
setShowGradientpublic static void setShowGradient(java.lang.String bool)Set GUI to show gradient image in the main canvas- Parameters:
- bool- true to display gradient image and false to display input image
 
- 
setDisplayFormatpublic 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")
 
- 
setGradientRadiuspublic static void setGradientRadius(java.lang.String radius)Set the gradient radius- Parameters:
- radius- gradient radius size (in pixels)
 
- 
setGradientTypepublic static void setGradientType(java.lang.String method)Set the gradient method to use- Parameters:
- method- name of the gradient method to use
 
 
-