Package adams.data.io.output
Class DeepLabCutCSVWriter
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractReportWriter>
,SizeOfHandler
,MultiReportWriter<Report>
,ReportWriter<Report>
,ObjectPrefixHandler
,Serializable
,Comparable
public class DeepLabCutCSVWriter extends AbstractMultiReportWriter<Report> implements ObjectPrefixHandler
Writes point annotations from multiple reports in DeepLabCut's CSV format.
Expects the filename to be stored in the 'File' report field.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-output <adams.core.io.PlaceholderFile> (property: output) The file to write the report to. default: ${TMP}/out.csv
-file-prefix <java.lang.String> (property: filePrefix) The file prefix (ie path) used in the output. default:
-individual <adams.core.base.BaseString> [-individual ...] (property: individuals) The individuals for multi-animal output, leave empty for single animal output. default:
-label <adams.core.base.BaseString> [-label ...] (property: labels) The labels to output. default:
-prefix <java.lang.String> (property: prefix) The report field prefix used in the report. default: Point.
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_FilePrefix
the file prefix to use.protected BaseString[]
m_Individuals
the number of individuals.protected BaseString[]
m_Labels
the labels to output.protected String
m_Prefix
the prefix to use.-
Fields inherited from class adams.data.io.output.AbstractReportWriter
m_Output
-
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 DeepLabCutCSVWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
filePrefixTipText()
Returns the tip text for this property.String
getFilePrefix()
Returns the file prefix (ie path) used.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension of the format.BaseString[]
getIndividuals()
Returns the names of the individuals to output (leave empty for single-animal output).BaseString[]
getLabels()
Returns the labels to output.String
getPrefix()
Returns the field prefix used in the report.Class
getReportClass()
Returns the class of the report that the writer supports.String
globalInfo()
Returns a string describing the object.String
individualsTipText()
Returns the tip text for this property.String
labelsTipText()
Returns the tip text for this property.String
prefixTipText()
Returns the tip text for this property.void
setFilePrefix(String value)
Sets the file prefix (ie path) to use.void
setIndividuals(BaseString[] value)
Sets the names of the number of individuals to output (leave empty for single-animal output).void
setLabels(BaseString[] value)
Sets the labels to output.void
setPrefix(String value)
Sets the field prefix used in the report.protected boolean
writeData(Report[] data)
Performs the actual writing.-
Methods inherited from class adams.data.io.output.AbstractMultiReportWriter
checkData, write, writeData
-
Methods inherited from class adams.data.io.output.AbstractReportWriter
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getOutput, getWriters, outputTipText, reset, setOutput, shallowCopy, shallowCopy, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.data.io.output.ReportWriter
getOutput, outputTipText, setOutput, write
-
-
-
-
Field Detail
-
m_FilePrefix
protected String m_FilePrefix
the file prefix to use.
-
m_Individuals
protected BaseString[] m_Individuals
the number of individuals.
-
m_Labels
protected BaseString[] m_Labels
the labels to output.
-
m_Prefix
protected String m_Prefix
the prefix to use.
-
-
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 classAbstractReportWriter<Report>
-
setFilePrefix
public void setFilePrefix(String value)
Sets the file prefix (ie path) to use.- Parameters:
value
- the prefix
-
getFilePrefix
public String getFilePrefix()
Returns the file prefix (ie path) used.- Returns:
- the prefix
-
filePrefixTipText
public String filePrefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setIndividuals
public void setIndividuals(BaseString[] value)
Sets the names of the number of individuals to output (leave empty for single-animal output).- Parameters:
value
- the individuals
-
getIndividuals
public BaseString[] getIndividuals()
Returns the names of the individuals to output (leave empty for single-animal output).- Returns:
- the individuals
-
individualsTipText
public String individualsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLabels
public void setLabels(BaseString[] value)
Sets the labels to output.- Parameters:
value
- the labels
-
getLabels
public BaseString[] getLabels()
Returns the labels to output.- Returns:
- the labels
-
labelsTipText
public String labelsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefix
in interfaceObjectPrefixHandler
- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipText
in interfaceObjectPrefixHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Specified by:
getFormatDescription
in classAbstractReportWriter<Report>
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension of the format.- Specified by:
getFormatExtensions
in interfaceFileFormatHandler
- Specified by:
getFormatExtensions
in classAbstractReportWriter<Report>
- Returns:
- the extension (without the dot!)
-
getReportClass
public Class getReportClass()
Returns the class of the report that the writer supports.- Specified by:
getReportClass
in interfaceMultiReportWriter<Report>
- Returns:
- the class
-
writeData
protected boolean writeData(Report[] data)
Performs the actual writing.- Specified by:
writeData
in classAbstractMultiReportWriter<Report>
- Parameters:
data
- the data to write- Returns:
- true if successfully written
-
-