Package adams.flow.transformer
Class NegativeRegions
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,InPlaceProcessing
,VariableChangeListener
,Actor
,ErrorHandler
,InputConsumer
,OutputProducer
,Serializable
,Comparable
public class NegativeRegions extends AbstractTransformer implements InPlaceProcessing
Uses the specified generator for generating negative regions for the image passing through.
Input/output:
- accepts:
adams.data.image.AbstractImageContainer
- generates:
adams.data.image.AbstractImageContainer
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-name <java.lang.String> (property: name) The name of the actor. default: NegativeRegions
-annotation <adams.core.base.BaseAnnotation> (property: annotations) The annotations to attach to this actor. default:
-skip <boolean> (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is. default: false
-stop-flow-on-error <boolean> (property: stopFlowOnError) If set to true, the flow execution at this level gets stopped in case this actor encounters an error; the error gets propagated; useful for critical actors. default: false
-silent <boolean> (property: silent) If enabled, then no errors are output in the console; Note: the enclosing actor handler must have this enabled as well. default: false
-algorithm <adams.flow.transformer.negativeregions.AbstractNegativeRegionsGenerator> (property: algorithm) The algorithm to use for generating the negative regions. default: adams.flow.transformer.negativeregions.Null
-transfer-type <ADD|REPLACE> (property: transferType) Determines how to transfer the generated negative regions into the image. default: ADD
-object-prefix <java.lang.String> (property: objectPrefix) The prefix that the objects are stored under in the report. default: Object.
-object-type <java.lang.String> (property: objectType) Defines the 'type' to use for the negative region objects (and stored in report), ignored if empty. default:
-no-copy <boolean> (property: noCopy) If enabled, no copy of the image container is created before adding the regions. default: false
-no-regions-no-output <boolean> (property: noRegionsNoOutput) If enabled, no container is forwarded if no negative regions were generated. default: false
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NegativeRegions.NegativeRegionTransferType
Determines how to add the regions to the image.
-
Field Summary
Fields Modifier and Type Field Description protected AbstractNegativeRegionsGenerator
m_ActualAlgorithm
the actual algorithm in use.protected AbstractNegativeRegionsGenerator
m_Algorithm
the algorithm to use.protected boolean
m_NoCopy
whether to skip creating a copy of the container.protected boolean
m_NoRegionsNoOutput
whether to suppress forwarding the container if no regions were generated.protected String
m_ObjectPrefix
the prefix that the objects use.protected String
m_ObjectType
the type to use for the region objects.protected NegativeRegions.NegativeRegionTransferType
m_TransferType
how to add the regions.-
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
-
-
Constructor Summary
Constructors Constructor Description NegativeRegions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the class that the consumer accepts.String
algorithmTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected String
doExecute()
Executes the flow item.Class[]
generates()
Returns the class of objects that it generates.AbstractNegativeRegionsGenerator
getAlgorithm()
Returns the algorithm in use.boolean
getNoCopy()
Returns whether to skip creating a copy of the image container before adding the regions.boolean
getNoRegionsNoOutput()
Returns whether to suppress forwarding the container if no negative regions were generated.String
getObjectPrefix()
Returns the prefix that the objects use in the report.String
getObjectType()
Returns the type to use for the negative region objects (and stored in report).String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.NegativeRegions.NegativeRegionTransferType
getTransferType()
Returns how to transfer the generated negative regions into the image.String
globalInfo()
Returns a string describing the object.String
noCopyTipText()
Returns the tip text for this property.String
noRegionsNoOutputTipText()
Returns the tip text for this property.String
objectPrefixTipText()
Returns the tip text for this property.String
objectTypeTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setAlgorithm(AbstractNegativeRegionsGenerator value)
Sets the algorithm to use.void
setNoCopy(boolean value)
Sets whether to skip creating a copy of the image container before adding the regions.void
setNoRegionsNoOutput(boolean value)
Sets whether to suppress forwarding the container if no negative regions were generated.void
setObjectPrefix(String value)
Sets the prefix that the objects use in the report.void
setObjectType(String value)
Sets the type to use for the negative region objects (and stored in report).void
setTransferType(NegativeRegions.NegativeRegionTransferType value)
Sets how to transfer the generated negative regions into the image.void
stopExecution()
Stops the execution.String
transferTypeTipText()
Returns the tip text for this property.-
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, cleanUp, 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, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, preExecute, pruneBackup, pruneBackup, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setUp, 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
cleanUp, compareTo, destroy, equals, 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, setUp, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, toCommandLine, variableChanged
-
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_Algorithm
protected AbstractNegativeRegionsGenerator m_Algorithm
the algorithm to use.
-
m_ActualAlgorithm
protected AbstractNegativeRegionsGenerator m_ActualAlgorithm
the actual algorithm in use.
-
m_TransferType
protected NegativeRegions.NegativeRegionTransferType m_TransferType
how to add the regions.
-
m_ObjectPrefix
protected String m_ObjectPrefix
the prefix that the objects use.
-
m_ObjectType
protected String m_ObjectType
the type to use for the region objects.
-
m_NoCopy
protected boolean m_NoCopy
whether to skip creating a copy of the container.
-
m_NoRegionsNoOutput
protected boolean m_NoRegionsNoOutput
whether to suppress forwarding the container if no regions were generated.
-
-
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 classAbstractActor
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractActor
-
setAlgorithm
public void setAlgorithm(AbstractNegativeRegionsGenerator value)
Sets the algorithm to use.- Parameters:
value
- the algorithm
-
getAlgorithm
public AbstractNegativeRegionsGenerator getAlgorithm()
Returns the algorithm in use.- Returns:
- the algorithm
-
algorithmTipText
public String algorithmTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTransferType
public void setTransferType(NegativeRegions.NegativeRegionTransferType value)
Sets how to transfer the generated negative regions into the image.- Parameters:
value
- the transfer type
-
getTransferType
public NegativeRegions.NegativeRegionTransferType getTransferType()
Returns how to transfer the generated negative regions into the image.- Returns:
- the transfer type
-
transferTypeTipText
public String transferTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setObjectPrefix
public void setObjectPrefix(String value)
Sets the prefix that the objects use in the report.- Parameters:
value
- the prefix
-
getObjectPrefix
public String getObjectPrefix()
Returns the prefix that the objects use in the report.- Returns:
- the prefix
-
objectPrefixTipText
public String objectPrefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setObjectType
public void setObjectType(String value)
Sets the type to use for the negative region objects (and stored in report).- Parameters:
value
- the object type
-
getObjectType
public String getObjectType()
Returns the type to use for the negative region objects (and stored in report).- Returns:
- the object type
-
objectTypeTipText
public String objectTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNoCopy
public void setNoCopy(boolean value)
Sets whether to skip creating a copy of the image container before adding the regions.- Specified by:
setNoCopy
in interfaceInPlaceProcessing
- Parameters:
value
- true if to skip creating copy
-
getNoCopy
public boolean getNoCopy()
Returns whether to skip creating a copy of the image container before adding the regions.- Specified by:
getNoCopy
in interfaceInPlaceProcessing
- Returns:
- true if copying is skipped
-
noCopyTipText
public String noCopyTipText()
Returns the tip text for this property.- Specified by:
noCopyTipText
in interfaceInPlaceProcessing
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNoRegionsNoOutput
public void setNoRegionsNoOutput(boolean value)
Sets whether to suppress forwarding the container if no negative regions were generated.- Parameters:
value
- true if to suppress if no regions generated
-
getNoRegionsNoOutput
public boolean getNoRegionsNoOutput()
Returns whether to suppress forwarding the container if no negative regions were generated.- Returns:
- true if to suppress if no regions generated
-
noRegionsNoOutputTipText
public String noRegionsNoOutputTipText()
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.- Specified by:
accepts
in interfaceInputConsumer
- Returns:
- the Class of objects that can be processed
-
generates
public Class[] generates()
Returns the class of objects that it generates.- Specified by:
generates
in interfaceOutputProducer
- Returns:
- the Class of the generated tokens
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceActor
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractActor
- Returns:
- null if no info available, otherwise short string
-
doExecute
protected String doExecute()
Executes the flow item.- Specified by:
doExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
stopExecution
public void stopExecution()
Stops the execution. No message set.- Specified by:
stopExecution
in interfaceActor
- Specified by:
stopExecution
in interfaceStoppable
- Overrides:
stopExecution
in classAbstractActor
-
-