Class SAM
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.gui.visualization.segmentation.tool.AbstractTool
-
- adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
-
- adams.gui.visualization.segmentation.tool.AbstractRedisTool<String,String>
-
- adams.gui.visualization.segmentation.tool.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
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_BaseImageBase64the cached base image as base64 JPEG.protected adams.gui.core.BaseCheckBoxm_CheckBoxForegroundwhether foreground or background.protected booleanm_Foregroundwhether foreground.protected Colorm_MarkerColorthe marker color.protected intm_MarkerSizethe marker size.protected adams.gui.core.BaseColorTextFieldm_TextMarkerColorthe marker color.protected adams.gui.core.NumberTextFieldm_TextMarkerSizethe marker size.-
Fields inherited from class adams.gui.visualization.segmentation.tool.AbstractRedisTool
m_Client, m_Connection, m_PubSubConnection, m_PubSubListener, m_ReceivedData, m_RedisDB, m_RedisHost, m_RedisPort, m_RedisReceive, m_RedisSend, m_RedisTimeout, m_TextRedisHost, m_TextRedisReceive, m_TextRedisSend, m_TextRedisTimeout
-
Fields inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
m_ButtonApply, m_ButtonFavorites, m_IgnoreOptionsUpdate, m_InitialOptions, m_ParameterPanel
-
-
Constructor Summary
Constructors Constructor Description SAM()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddOptions(adams.gui.core.ParameterPanel paramPanel)Fills the parameter panel with the options.voidannotationsChanged()Hook method for when new annotations have been set.protected StringassembleSendData(adams.core.MessageCollection errors)Method that assembles the data to send.protected CursorcreateCursor()Creates the mouse cursor to use.protected adams.gui.visualization.segmentation.tool.ToolKeyAdaptercreateKeyListener()Creates the key listener to use.protected adams.gui.visualization.segmentation.tool.ToolMouseAdaptercreateMouseListener()Creates the mouse listener to use.protected adams.gui.visualization.segmentation.tool.ToolMouseMotionAdaptercreateMouseMotionListener()Creates the mouse motion listener to use.protected voidfinishedRequest()Finishes up the request.protected intgetDefaultTimeout()Returns the default timeout in msec.IcongetIcon()The icon of the tool.StringgetName()The name of the tool.protected StringgetReceiveChannel()The channel to receive the data on.protected RedisDataTypegetReceiveType()Returns the type of data to receive.protected StringgetSendChannel()The channel to send the data on.protected RedisDataTypegetSendType()Returns the type of data to send.StringglobalInfo()Returns a string describing the object.protected voidparseReceivedData(String data, adams.core.MessageCollection errors)Parses the received data and updates the GUI.protected voidretrieveParameters()Retrieves the parameters from the GUI.-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractRedisTool
checkBeforeApply, cleanUp, doApply, newBytesListener, newStringListener, sendData
-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractToolWithParameterPanel
apply, applyOptions, applyOptionsQuietly, createOptionPanel, getCurrentOptions, getFavoritesOptions, getOption, getOptionPanel, initialize, postProcessCurrentOptions, retrieveCurrentOptions, setFavoritesOptions, setInitialOptions, setOption, showFavoritesMenu, updateOptions
-
Methods inherited from class adams.gui.visualization.segmentation.tool.AbstractTool
activate, createApplyButton, createPaintOperation, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getModifiedIcon, getMouseListener, getMouseMotionListener, getPaintOperation, getUnmodifiedIcon, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, isAutomaticUndoEnabled, setApplyButtonState, setCanvas
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.gui.visualization.segmentation.tool.Tool
activate, deactivate, getActiveColor, getActiveCombinedSubLayer, getActiveImage, getActiveOverlay, getCanvas, getCursor, getKeyListener, getLayerManager, getMouseListener, getMouseMotionListener, getPaintOperation, getZoom, hasActiveCombinedSubLayer, hasActiveOverlay, hasAnyActive, isAutomaticUndoEnabled, setCanvas
-
-
-
-
Field Detail
-
m_TextMarkerSize
protected adams.gui.core.NumberTextField m_TextMarkerSize
the marker size.
-
m_TextMarkerColor
protected adams.gui.core.BaseColorTextField m_TextMarkerColor
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.
-
-
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:
createCursorin classadams.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:
createMouseListenerin classadams.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:
createMouseMotionListenerin classadams.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:
createKeyListenerin classadams.gui.visualization.segmentation.tool.AbstractTool- Returns:
- the listener, null if not applicable
-
retrieveParameters
protected void retrieveParameters()
Retrieves the parameters from the GUI.- Overrides:
retrieveParametersin classAbstractRedisTool<String,String>
-
getSendChannel
protected String getSendChannel()
The channel to send the data on.- Specified by:
getSendChannelin classAbstractRedisTool<String,String>- Returns:
- the redis channel
-
getReceiveChannel
protected String getReceiveChannel()
The channel to receive the data on.- Specified by:
getReceiveChannelin classAbstractRedisTool<String,String>- Returns:
- the redis channel
-
getDefaultTimeout
protected int getDefaultTimeout()
Returns the default timeout in msec.- Overrides:
getDefaultTimeoutin classAbstractRedisTool<String,String>- Returns:
- the timeout
-
addOptions
protected void addOptions(adams.gui.core.ParameterPanel paramPanel)
Fills the parameter panel with the options.- Overrides:
addOptionsin classAbstractRedisTool<String,String>- Parameters:
paramPanel- for adding the options to
-
getSendType
protected RedisDataType getSendType()
Returns the type of data to send.- Specified by:
getSendTypein classAbstractRedisTool<String,String>- Returns:
- the type of data
-
getReceiveType
protected RedisDataType getReceiveType()
Returns the type of data to receive.- Specified by:
getReceiveTypein classAbstractRedisTool<String,String>- Returns:
- the type of data
-
assembleSendData
protected String assembleSendData(adams.core.MessageCollection errors)
Method that assembles the data to send.- Specified by:
assembleSendDatain classAbstractRedisTool<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:
parseReceivedDatain classAbstractRedisTool<String,String>- Parameters:
data- the data to parse (String or byte[])errors- for collecting errors
-
finishedRequest
protected void finishedRequest()
Finishes up the request.- Overrides:
finishedRequestin classAbstractRedisTool<String,String>
-
annotationsChanged
public void annotationsChanged()
Hook method for when new annotations have been set.- Specified by:
annotationsChangedin interfaceadams.gui.visualization.segmentation.tool.Tool- Overrides:
annotationsChangedin classAbstractRedisTool<String,String>
-
-