Package adams.flow.transformer
Class PixelSelector
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,Actor
,ErrorHandler
,InputConsumer
,InteractiveActor
,OutputProducer
,StopModeSupporter
,Serializable
,Comparable
public class PixelSelector extends AbstractInteractiveTransformerDialog
Allows the user to select pixels. How the pixels are interpreted depends on the actions selected.
In addition, overlays that visualize the information stored in the image's report can be selected as well. The overlays offer information on what actions generate the data that is required for proper visualization.
Input/output:
- accepts:
adams.data.image.AbstractImage
- generates:
adams.data.image.AbstractImage
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-name <java.lang.String> (property: name) The name of the actor. default: PixelSelector
-annotation <adams.core.base.BaseText> (property: annotations) The annotations to attach to this actor. default:
-skip (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is.
-stop-flow-on-error (property: stopFlowOnError) If set to true, the flow gets stopped in case this actor encounters an error; useful for critical actors.
-width <int> (property: width) The width of the dialog. default: 800 minimum: 1
-height <int> (property: height) The height of the dialog. default: 600 minimum: 1
-x <int> (property: x) The X position of the dialog (>=0: absolute, -1: left, -2: center, -3: right ). default: -1 minimum: -3
-y <int> (property: y) The Y position of the dialog (>=0: absolute, -1: top, -2: center, -3: bottom ). default: -1 minimum: -3
-stop-if-canceled (property: stopFlowIfCanceled) If enabled, the flow gets stopped in case the user cancels the dialog.
-custom-stop-message <java.lang.String> (property: customStopMessage) The custom stop message to use in case a user cancelation stops the flow (default is the full name of the actor) default:
-action <adams.flow.transformer.pixelselector.AbstractPixelSelectorAction> [-action ...] (property: actions) The overlays available to the user from the popup menu of the viewer. default:
-overlay <adams.flow.transformer.pixelselector.AbstractPixelSelectorOverlay> [-overlay ...] (property: overlays) The image overlays to use in the viewer. default:
-splitter-pos <int> (property: splitterPosition) The initial position of the splitter in the viewer panel. default: 500 minimum: 1
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractPixelSelectorAction[]
m_Actions
the actions that are available from the popup menu.protected Boolean
m_Approved
whether the user approved (or canceled) the dialog.protected AbstractPixelSelectorOverlay[]
m_Overlays
the overlays to use.protected int
m_SplitterPosition
the position of the splitter.-
Fields inherited from class adams.flow.transformer.AbstractInteractiveTransformerDialog
m_CustomStopMessage, m_Dialog, m_Height, m_LastPosition, m_LastSize, m_Panel, m_ShortTitle, m_StopFlowIfCanceled, m_StopMode, m_Width, m_X, m_Y
-
Fields inherited from class adams.flow.transformer.AbstractTransformer
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken
-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
Fields inherited from interface adams.flow.core.InteractiveActor
INTERACTION_CANCELED
-
-
Constructor Summary
Constructors Constructor Description PixelSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.String
actionsTipText()
Returns the tip text for this property.void
clearPanel()
Clears the content of the panel.void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the flow item.String
doInteract()
Performs the interaction with the user.Class[]
generates()
Returns the class of objects that it generates.AbstractPixelSelectorAction[]
getActions()
Returns the available popup actions.protected int
getDefaultSplitterPosition()
Returns the default position for the splitter.AbstractPixelSelectorOverlay[]
getOverlays()
Returns the available image overlays.int
getSplitterPosition()
Returns the initial position of the splitter in the viewer panel.String
globalInfo()
Returns a string describing the object.protected BasePanel
newPanel()
Creates the panel to display in the dialog.String
overlaysTipText()
Returns the tip text for this property.void
setActions(AbstractPixelSelectorAction[] value)
Sets the available popup actions.void
setOverlays(AbstractPixelSelectorOverlay[] value)
Sets the available image overlays.void
setSplitterPosition(int value)
Sets the initial position of the splitter in the viewer panel.String
setUp()
Initializes the item for flow execution.String
splitterPositionTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.AbstractInteractiveTransformerDialog
cleanUp, cleanUpGUI, createDialog, createTitle, customStopMessageTipText, deregisterWindow, doCreateDialog, doInteractHeadless, getCustomStopMessage, getDefaultHeight, getDefaultWidth, getDefaultX, getDefaultY, getDialog, getHeight, getPanel, getQuickInfo, getShortTitle, getStopFlowIfCanceled, getStopMode, getWidth, getX, getY, heightTipText, initialize, postCreateDialog, preCreateDialog, registerWindow, reset, setCustomStopMessage, setHeight, setShortTitle, setStopFlowIfCanceled, setStopMode, setWidth, setX, setY, shortTitleTipText, stopExecution, stopFlowIfCanceledTipText, stopModeTipText, supportsHeadlessInteraction, widthTipText, xTipText, yTipText
-
Methods inherited from class adams.flow.transformer.AbstractTransformer
backupState, currentInput, execute, hasInput, hasPendingOutput, input, output, postExecute, restoreState, wrapUp
-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, canInspectOptions, canPerformSetUpCheck, compareTo, configureLogger, destroy, equals, finalUpdateVariables, findVariables, findVariables, forceVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, preExecute, pruneBackup, pruneBackup, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, toCommandLine, variableChanged, wrapUp
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
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.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
Methods inherited from interface adams.core.VariablesInspectionHandler
canInspectOptions
-
-
-
-
Field Detail
-
m_Actions
protected AbstractPixelSelectorAction[] m_Actions
the actions that are available from the popup menu.
-
m_Overlays
protected AbstractPixelSelectorOverlay[] m_Overlays
the overlays to use.
-
m_SplitterPosition
protected int m_SplitterPosition
the position of the splitter.
-
m_Approved
protected Boolean m_Approved
whether the user approved (or canceled) the dialog.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractInteractiveTransformerDialog
-
setActions
public void setActions(AbstractPixelSelectorAction[] value)
Sets the available popup actions.- Parameters:
value
- the actions
-
getActions
public AbstractPixelSelectorAction[] getActions()
Returns the available popup actions.- Returns:
- the actions
-
actionsTipText
public String actionsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOverlays
public void setOverlays(AbstractPixelSelectorOverlay[] value)
Sets the available image overlays.- Parameters:
value
- the overlays
-
getOverlays
public AbstractPixelSelectorOverlay[] getOverlays()
Returns the available image overlays.- Returns:
- the overlays
-
overlaysTipText
public String overlaysTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultSplitterPosition
protected int getDefaultSplitterPosition()
Returns the default position for the splitter.
-
setSplitterPosition
public void setSplitterPosition(int value)
Sets the initial position of the splitter in the viewer panel.- Parameters:
value
- the position
-
getSplitterPosition
public int getSplitterPosition()
Returns the initial position of the splitter in the viewer panel.- Returns:
- the position
-
splitterPositionTipText
public String splitterPositionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Returns:
- the Class of objects that can be processed
-
generates
public Class[] generates()
Returns the class of objects that it generates.- Returns:
- adams.data.image.AbstractImage.class
-
clearPanel
public void clearPanel()
Clears the content of the panel.- Specified by:
clearPanel
in classAbstractInteractiveTransformerDialog
-
newPanel
protected BasePanel newPanel()
Creates the panel to display in the dialog.- Specified by:
newPanel
in classAbstractInteractiveTransformerDialog
- Returns:
- the panel
-
setUp
public String setUp()
Initializes the item for flow execution.- Specified by:
setUp
in interfaceActor
- Overrides:
setUp
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
- See Also:
AbstractActor.reset()
-
doInteract
public String doInteract()
Performs the interaction with the user.- Specified by:
doInteract
in interfaceInteractiveActor
- Overrides:
doInteract
in classAbstractInteractiveTransformerDialog
- Returns:
- true if successfully interacted
-
doExecute
protected String doExecute()
Executes the flow item.- Overrides:
doExecute
in classAbstractInteractiveTransformerDialog
- Returns:
- null if everything is fine, otherwise error message
-
-