Package adams.data.io.output
Class AbstractImageSegmentationAnnotationWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractImageSegmentationAnnotationWriter
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,FileFormatHandler,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,ImageSegmentationAnnotationWriter,Serializable
- Direct Known Subclasses:
AbstractPNGAnnotationImageSegmentationWriter,IndividualImageSegmentationLayerWriter
public abstract class AbstractImageSegmentationAnnotationWriter extends AbstractOptionHandler implements ImageSegmentationAnnotationWriter
Ancestor for writers for image segmentation annotations.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_SkipBaseImagewhether to skip writing base image.-
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 AbstractImageSegmentationAnnotationWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Stringcheck(PlaceholderFile file, ImageSegmentationContainer annotations)Hook method for performing checks before writing the data.voiddefineOptions()Adds options to the internal list of options.protected abstract StringdoWrite(PlaceholderFile file, ImageSegmentationContainer annotations)Writes the image segmentation annotations.abstract ImageSegmentationAnnotationReadergetCorrespondingReader()Returns, if available, the corresponding reader.booleangetSkipBaseImage()Returns whether to skip writing the base image.voidsetSkipBaseImage(boolean value)Sets whether to skip writing the base image.StringskipBaseImageTipText()Returns the tip text for this property.Stringwrite(PlaceholderFile file, ImageSegmentationContainer annotations)Writes the image segmentation annotations.protected StringwriteBaseImage(PlaceholderFile file, ImageSegmentationContainer annotations)Writes the base image unless skipped.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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.io.FileFormatHandler
getDefaultFormatExtension, getFormatDescription, getFormatExtensions
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setSkipBaseImage
public void setSkipBaseImage(boolean value)
Sets whether to skip writing the base image.- Parameters:
value- true if to skip
-
getSkipBaseImage
public boolean getSkipBaseImage()
Returns whether to skip writing the base image.- Returns:
- true if to skip
-
skipBaseImageTipText
public String skipBaseImageTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getCorrespondingReader
public abstract ImageSegmentationAnnotationReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Specified by:
getCorrespondingReaderin interfaceImageSegmentationAnnotationWriter- Returns:
- the reader, null if none available
-
check
protected String check(PlaceholderFile file, ImageSegmentationContainer annotations)
Hook method for performing checks before writing the data.- Parameters:
file- the file to checkannotations- the annotations to write- Returns:
- null if no errors, otherwise error message
-
writeBaseImage
protected String writeBaseImage(PlaceholderFile file, ImageSegmentationContainer annotations)
Writes the base image unless skipped.- Parameters:
file- the filename for the base imageannotations- the container with the layers and base image- Returns:
- null if successfully written, otherwise error message
-
doWrite
protected abstract String doWrite(PlaceholderFile file, ImageSegmentationContainer annotations)
Writes the image segmentation annotations.- Parameters:
file- the file to write toannotations- the annotations to write- Returns:
- null if successfully written, otherwise error message
-
write
public String write(PlaceholderFile file, ImageSegmentationContainer annotations)
Writes the image segmentation annotations.- Specified by:
writein interfaceImageSegmentationAnnotationWriter- Parameters:
file- the file to write toannotations- the annotations to write- Returns:
- null if successfully written, otherwise error message
-
-