Class AbstractImagePreparation
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.imagepreparation.AbstractImagePreparation
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,Serializable
- Direct Known Subclasses:
PassThrough
public abstract class AbstractImagePreparation extends AbstractOptionHandler implements Stoppable
Ancestor for algorithms that preprocess images.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
m_Errors
for storing errors.protected boolean
m_Stopped
whether the preparation was stopped.protected List<String>
m_Warnings
for storing warnings.-
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 AbstractImagePreparation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addError(String msg)
Adds the error to its internal list of errors.protected void
addWarning(String msg)
Adds the warning to its internal list of warnings.protected void
check(BufferedImage image)
Checks whether the input can be used.protected abstract BufferedImage
doProcess(BufferedImage image)
Performs the actual processing of the image.List<String>
getErrors()
Returns the errors.List<String>
getWarnings()
Returns the warnings.boolean
hasErrors()
Checks whether there are any errors recorded;boolean
hasWarnings()
Checks whether there are any warnings recorded;protected void
initialize()
Initializes the members.BufferedImage
process(BufferedImage image)
Processes the image.protected void
reset()
Resets the scheme.void
stopExecution()
Stops the execution.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
hasErrors
public boolean hasErrors()
Checks whether there are any errors recorded;- Returns:
- true if at least one error recorded
-
addError
protected void addError(String msg)
Adds the error to its internal list of errors.- Parameters:
msg
- the error message to add
-
hasWarnings
public boolean hasWarnings()
Checks whether there are any warnings recorded;- Returns:
- true if at least one error recorded
-
addWarning
protected void addWarning(String msg)
Adds the warning to its internal list of warnings.- Parameters:
msg
- the warnings message to add
-
check
protected void check(BufferedImage image)
Checks whether the input can be used.
Default implementation only checks whether image is not null.- Parameters:
image
- the image to check
-
doProcess
protected abstract BufferedImage doProcess(BufferedImage image)
Performs the actual processing of the image.- Parameters:
image
- the image with the seedlings- Returns:
- the processed image
-
process
public BufferedImage process(BufferedImage image)
Processes the image.- Parameters:
image
- the image with the seedlings- Returns:
- the process image
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecution
in interfaceStoppable
-
-