Package adams.data.io.output
Class AbstractPNGAnnotationImageSegmentationWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractImageSegmentationAnnotationWriter
-
- adams.data.io.output.AbstractPNGAnnotationImageSegmentationWriter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ImageSegmentationAnnotationWriter
,ImageSegmentationAnnotationWriterWithLayerNames
,Serializable
- Direct Known Subclasses:
AbstractImplicitBackgroundPNGAnnotationImageSegmentationWriter
,IndexedPNGImageSegmentationWriter
public abstract class AbstractPNGAnnotationImageSegmentationWriter extends AbstractImageSegmentationAnnotationWriter implements ImageSegmentationAnnotationWriterWithLayerNames
Ancestor for image segmentation annotation writers that store the annotations in a single PNG file.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseString[]
m_LayerNames
the layer names.-
Fields inherited from class adams.data.io.output.AbstractImageSegmentationAnnotationWriter
m_SkipBaseImage
-
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 AbstractPNGAnnotationImageSegmentationWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
check(PlaceholderFile file, ImageSegmentationContainer annotations)
Hook method for performing checks before writing the data.void
defineOptions()
Adds options to the internal list of options.protected PlaceholderFile
getAnnotationFile(PlaceholderFile file)
Generates the annotation file name.String
getDefaultFormatExtension()
Returns the default extension of the format.String[]
getFormatExtensions()
Returns the extension(s) of the format.BaseString[]
getLayerNames()
Returns the names for the layers to use; outputs all if none specified.protected String[]
getLayerNames(ImageSegmentationContainer annotations)
Returns the names of the layers to output.String
layerNamesTipText()
Returns the tip text for this property.void
setLayerNames(BaseString[] value)
Sets the names for the layers to use; outputs all if none specified.-
Methods inherited from class adams.data.io.output.AbstractImageSegmentationAnnotationWriter
doWrite, getCorrespondingReader, getSkipBaseImage, setSkipBaseImage, skipBaseImageTipText, write, writeBaseImage
-
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
getFormatDescription
-
Methods inherited from interface adams.data.io.output.ImageSegmentationAnnotationWriter
getCorrespondingReader, write
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_LayerNames
protected BaseString[] m_LayerNames
the layer names.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractImageSegmentationAnnotationWriter
-
setLayerNames
public void setLayerNames(BaseString[] value)
Sets the names for the layers to use; outputs all if none specified.- Specified by:
setLayerNames
in interfaceImageSegmentationAnnotationWriterWithLayerNames
- Parameters:
value
- the names
-
getLayerNames
public BaseString[] getLayerNames()
Returns the names for the layers to use; outputs all if none specified.- Specified by:
getLayerNames
in interfaceImageSegmentationAnnotationWriterWithLayerNames
- Returns:
- the names
-
layerNamesTipText
public String layerNamesTipText()
Returns the tip text for this property.- Specified by:
layerNamesTipText
in interfaceImageSegmentationAnnotationWriterWithLayerNames
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceFileFormatHandler
- Returns:
- the extension (without the dot!)
-
getDefaultFormatExtension
public String getDefaultFormatExtension()
Returns the default extension of the format.- Specified by:
getDefaultFormatExtension
in interfaceFileFormatHandler
- Returns:
- the default extension (without the dot!)
-
check
protected String check(PlaceholderFile file, ImageSegmentationContainer annotations)
Hook method for performing checks before writing the data.- Overrides:
check
in classAbstractImageSegmentationAnnotationWriter
- Parameters:
file
- the file to checkannotations
- the annotations to write- Returns:
- null if no errors, otherwise error message
-
getLayerNames
protected String[] getLayerNames(ImageSegmentationContainer annotations)
Returns the names of the layers to output.- Parameters:
annotations
- the annotations to use as basis- Returns:
- the layer names
-
getAnnotationFile
protected PlaceholderFile getAnnotationFile(PlaceholderFile file)
Generates the annotation file name.- Parameters:
file
- the base file name (ie JPG)- Returns:
- the PNG file name
-
-