Package adams.data.io.input
Class AbstractImageSegmentationAnnotationReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractImageSegmentationAnnotationReader
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ImageSegmentationAnnotationReader
,Serializable
- Direct Known Subclasses:
AbstractPNGAnnotationImageSegmentationReader
,IndividualImageSegmentationLayerReader
public abstract class AbstractImageSegmentationAnnotationReader extends AbstractOptionHandler implements ImageSegmentationAnnotationReader
Ancestor for readers 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 PlaceholderDirectory
m_AlternativeAnnotationDir
the alternative annotation directory.protected boolean
m_UseAlternativeAnnotationDir
whether to use an alternative annotation directory.-
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 AbstractImageSegmentationAnnotationReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
alternativeAnnotationDirTipText()
Returns the tip text for this property.protected String
check(PlaceholderFile file)
Hook method for performing checks before reading the data.void
defineOptions()
Adds options to the internal list of options.protected abstract ImageSegmentationContainer
doRead(PlaceholderFile file)
Reads the image segmentation annotations.PlaceholderDirectory
getAlternativeAnnotationDir()
Returns the alternative directory for the annotations.abstract ImageSegmentationAnnotationWriter
getCorrespondingWriter()
Returns, if available, the corresponding writer.boolean
getUseAlternativeAnnotationDir()
Returns whether to use an alternative directory for the annotations.ImageSegmentationContainer
read(PlaceholderFile file)
Reads the image segmentation annotations.void
setAlternativeAnnotationDir(PlaceholderDirectory value)
Sets the alternative directory for the annotations.void
setUseAlternativeAnnotationDir(boolean value)
Sets whether to use an alternative directory for the annotations.String
useAlternativeAnnotationDirTipText()
Returns the tip text for this property.-
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
-
-
-
-
Field Detail
-
m_UseAlternativeAnnotationDir
protected boolean m_UseAlternativeAnnotationDir
whether to use an alternative annotation directory.
-
m_AlternativeAnnotationDir
protected PlaceholderDirectory m_AlternativeAnnotationDir
the alternative annotation directory.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setUseAlternativeAnnotationDir
public void setUseAlternativeAnnotationDir(boolean value)
Sets whether to use an alternative directory for the annotations.- Specified by:
setUseAlternativeAnnotationDir
in interfaceImageSegmentationAnnotationReader
- Parameters:
value
- true if to use alternative dir
-
getUseAlternativeAnnotationDir
public boolean getUseAlternativeAnnotationDir()
Returns whether to use an alternative directory for the annotations.- Specified by:
getUseAlternativeAnnotationDir
in interfaceImageSegmentationAnnotationReader
- Returns:
- true if to use alternative dir
-
useAlternativeAnnotationDirTipText
public String useAlternativeAnnotationDirTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAlternativeAnnotationDir
public void setAlternativeAnnotationDir(PlaceholderDirectory value)
Sets the alternative directory for the annotations.- Specified by:
setAlternativeAnnotationDir
in interfaceImageSegmentationAnnotationReader
- Parameters:
value
- the alternative dir
-
getAlternativeAnnotationDir
public PlaceholderDirectory getAlternativeAnnotationDir()
Returns the alternative directory for the annotations.- Specified by:
getAlternativeAnnotationDir
in interfaceImageSegmentationAnnotationReader
- Returns:
- the alternative dir
-
alternativeAnnotationDirTipText
public String alternativeAnnotationDirTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getCorrespondingWriter
public abstract ImageSegmentationAnnotationWriter getCorrespondingWriter()
Returns, if available, the corresponding writer.- Specified by:
getCorrespondingWriter
in interfaceImageSegmentationAnnotationReader
- Returns:
- the writer, null if none available
-
check
protected String check(PlaceholderFile file)
Hook method for performing checks before reading the data.- Parameters:
file
- the file to check- Returns:
- null if no errors, otherwise error message
-
doRead
protected abstract ImageSegmentationContainer doRead(PlaceholderFile file)
Reads the image segmentation annotations.- Parameters:
file
- the file to read from- Returns:
- the annotations
-
read
public ImageSegmentationContainer read(PlaceholderFile file)
Reads the image segmentation annotations.- Specified by:
read
in interfaceImageSegmentationAnnotationReader
- Parameters:
file
- the file to read from- Returns:
- the annotations
-
-