Class SAM

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, adams.gui.visualization.segmentation.tool.CustomizableTool, adams.gui.visualization.segmentation.tool.Tool, Serializable

    public class SAM
    extends AbstractRedisTool<String,​String>
    Uses SAM (via docker and redis) to aid human in annotating.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SAM()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addOptions​(adams.gui.core.ParameterPanel paramPanel)
      Fills the parameter panel with the options.
      void annotationsChanged()
      Hook method for when new annotations have been set.
      protected String assembleSendData​(adams.core.MessageCollection errors)
      Method that assembles the data to send.
      protected Cursor createCursor()
      Creates the mouse cursor to use.
      protected adams.gui.visualization.segmentation.tool.ToolKeyAdapter createKeyListener()
      Creates the key listener to use.
      protected adams.gui.visualization.segmentation.tool.ToolMouseAdapter createMouseListener()
      Creates the mouse listener to use.
      protected adams.gui.visualization.segmentation.tool.ToolMouseMotionAdapter createMouseMotionListener()
      Creates the mouse motion listener to use.
      protected void finishedRequest()
      Finishes up the request.
      protected int getDefaultTimeout()
      Returns the default timeout in msec.
      Icon getIcon()
      The icon of the tool.
      String getName()
      The name of the tool.
      protected String getReceiveChannel()
      The channel to receive the data on.
      protected RedisDataType getReceiveType()
      Returns the type of data to receive.
      protected String getSendChannel()
      The channel to send the data on.
      protected RedisDataType getSendType()
      Returns the type of data to send.
      String globalInfo()
      Returns a string describing the object.
      protected void parseReceivedData​(String data, adams.core.MessageCollection errors)
      Parses the received data and updates the GUI.
      protected void retrieveParameters()
      Retrieves the parameters from the GUI.
      • Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel

        applyOptions, createOptionPanel
      • Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractTool

        activate, apply, createApplyButton, createPaintOperation, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getOptionPanel, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, initialize, isAutomaticUndoEnabled, setApplyButtonState, setCanvas
      • Methods inherited from class adams.core.logging.CustomLoggingLevelObject

        setLoggingLevel
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel, setLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
      • Methods inherited from interface adams.gui.visualization.segmentation.tool.Tool

        activate, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getOptionPanel, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, isAutomaticUndoEnabled, setCanvas
    • Field Detail

      • m_TextMarkerSize

        protected adams.gui.core.NumberTextField m_TextMarkerSize
        the marker size.
      • m_PanelColor

        protected adams.gui.chooser.ColorChooserPanel m_PanelColor
        the marker color.
      • m_CheckBoxForeground

        protected adams.gui.core.BaseCheckBox m_CheckBoxForeground
        whether foreground or background.
      • m_MarkerSize

        protected int m_MarkerSize
        the marker size.
      • m_MarkerColor

        protected Color m_MarkerColor
        the marker color.
      • m_Foreground

        protected boolean m_Foreground
        whether foreground.
      • m_BaseImageBase64

        protected transient String m_BaseImageBase64
        the cached base image as base64 JPEG.
    • Constructor Detail

      • SAM

        public SAM()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Returns:
        a description suitable for displaying in the gui
      • getName

        public String getName()
        The name of the tool.
        Returns:
        the name
      • getIcon

        public Icon getIcon()
        The icon of the tool.
        Returns:
        the icon
      • createCursor

        protected Cursor createCursor()
        Creates the mouse cursor to use.
        Specified by:
        createCursor in class adams.gui.visualization.segmentation.tool.AbstractTool
        Returns:
        the cursor
      • createMouseListener

        protected adams.gui.visualization.segmentation.tool.ToolMouseAdapter createMouseListener()
        Creates the mouse listener to use.
        Specified by:
        createMouseListener in class adams.gui.visualization.segmentation.tool.AbstractTool
        Returns:
        the listener, null if not applicable
      • createMouseMotionListener

        protected adams.gui.visualization.segmentation.tool.ToolMouseMotionAdapter createMouseMotionListener()
        Creates the mouse motion listener to use.
        Specified by:
        createMouseMotionListener in class adams.gui.visualization.segmentation.tool.AbstractTool
        Returns:
        the listener, null if not applicable
      • createKeyListener

        protected adams.gui.visualization.segmentation.tool.ToolKeyAdapter createKeyListener()
        Creates the key listener to use.
        Overrides:
        createKeyListener in class adams.gui.visualization.segmentation.tool.AbstractTool
        Returns:
        the listener, null if not applicable
      • addOptions

        protected void addOptions​(adams.gui.core.ParameterPanel paramPanel)
        Fills the parameter panel with the options.
        Overrides:
        addOptions in class AbstractRedisTool<String,​String>
        Parameters:
        paramPanel - for adding the options to
      • assembleSendData

        protected String assembleSendData​(adams.core.MessageCollection errors)
        Method that assembles the data to send.
        Specified by:
        assembleSendData in class AbstractRedisTool<String,​String>
        Parameters:
        errors - for collecting errors
        Returns:
        the data to send (String or byte[])
      • parseReceivedData

        protected void parseReceivedData​(String data,
                                         adams.core.MessageCollection errors)
        Parses the received data and updates the GUI.
        Specified by:
        parseReceivedData in class AbstractRedisTool<String,​String>
        Parameters:
        data - the data to parse (String or byte[])
        errors - for collecting errors
      • annotationsChanged

        public void annotationsChanged()
        Hook method for when new annotations have been set.
        Specified by:
        annotationsChanged in interface adams.gui.visualization.segmentation.tool.Tool
        Overrides:
        annotationsChanged in class AbstractRedisTool<String,​String>