Package adams.data.objectfilter
Class KeepEnclosed
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.objectfilter.AbstractObjectFilter
-
- adams.data.objectfilter.KeepEnclosed
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ObjectFilter
,FlowContextHandler
,Serializable
public class KeepEnclosed extends AbstractObjectFilter
Uses the outlines of annotations with the specified label to filter out any objects that aren't enclosed by these.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-key <java.lang.String> (property: key) The key in the meta-data containing the label. default: type
-label <java.lang.String> (property: label) The label of the enclosing objects. default: object
-allow-partial <boolean> (property: allowPartial) Whether to keep only partially enclosed objects as well. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AllowPartial
whether to allow partially enclosed objects.protected String
m_Key
the key in the meta-data containing the labels.protected String
m_Label
the label of the enclosing annotations.-
Fields inherited from class adams.data.objectfilter.AbstractObjectFilter
m_FlowContext
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description KeepEnclosed()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
allowPartialTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected LocatedObjects
doFilter(LocatedObjects objects)
Filters the image objects.boolean
getAllowPartial()
Returns whether to keep partially enclosed objects as well.String
getKey()
Returns the key in the meta-data containing the label.String
getLabel()
Returns the label of the enclosing objects.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.String
globalInfo()
Returns a string describing the object.String
keyTipText()
Returns the tip text for this property.String
labelTipText()
Returns the tip text for this property.void
setAllowPartial(boolean value)
Sets whether to keep partially enclosed objects as well.void
setKey(String value)
Sets the key in the meta-data containing the label.void
setLabel(String value)
Sets the label of the enclosing objects.-
Methods inherited from class adams.data.objectfilter.AbstractObjectFilter
check, filter, getFlowContext, requiresFlowContext, setFlowContext
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
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, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
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 classAbstractOptionHandler
-
setKey
public void setKey(String value)
Sets the key in the meta-data containing the label.- Parameters:
value
- the key
-
getKey
public String getKey()
Returns the key in the meta-data containing the label.- Returns:
- the key
-
keyTipText
public String keyTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabel
public void setLabel(String value)
Sets the label of the enclosing objects.- Parameters:
value
- the label
-
getLabel
public String getLabel()
Returns the label of the enclosing objects.- Returns:
- the label
-
labelTipText
public String labelTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAllowPartial
public void setAllowPartial(boolean value)
Sets whether to keep partially enclosed objects as well.- Parameters:
value
- true if to allow
-
getAllowPartial
public boolean getAllowPartial()
Returns whether to keep partially enclosed objects as well.- Returns:
- true if to allow
-
allowPartialTipText
public String allowPartialTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractObjectFilter
- Returns:
- null if no info available, otherwise short string
-
doFilter
protected LocatedObjects doFilter(LocatedObjects objects)
Filters the image objects.- Specified by:
doFilter
in classAbstractObjectFilter
- Parameters:
objects
- the objects to filter- Returns:
- the updated object list
-
-