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 Stringm_FilePrefixthe file prefix to use.protected BaseString[]m_Individualsthe number of individuals.protected BaseString[]m_Labelsthe labels to output.protected Stringm_Prefixthe 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 voiddefineOptions()Adds options to the internal list of options.StringfilePrefixTipText()Returns the tip text for this property.StringgetFilePrefix()Returns the file prefix (ie path) used.StringgetFormatDescription()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.StringgetPrefix()Returns the field prefix used in the report.ClassgetReportClass()Returns the class of the report that the writer supports.StringglobalInfo()Returns a string describing the object.StringindividualsTipText()Returns the tip text for this property.StringlabelsTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.voidsetFilePrefix(String value)Sets the file prefix (ie path) to use.voidsetIndividuals(BaseString[] value)Sets the names of the number of individuals to output (leave empty for single-animal output).voidsetLabels(BaseString[] value)Sets the labels to output.voidsetPrefix(String value)Sets the field prefix used in the report.protected booleanwriteData(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
setPrefixin interfaceObjectPrefixHandler- Parameters:
value- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefixin interfaceObjectPrefixHandler- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipTextin 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:
getFormatDescriptionin interfaceFileFormatHandler- Specified by:
getFormatDescriptionin classAbstractReportWriter<Report>- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Specified by:
getFormatExtensionsin classAbstractReportWriter<Report>- Returns:
- the extension (without the dot!)
-
getReportClass
public Class getReportClass()
Returns the class of the report that the writer supports.- Specified by:
getReportClassin interfaceMultiReportWriter<Report>- Returns:
- the class
-
writeData
protected boolean writeData(Report[] data)
Performs the actual writing.- Specified by:
writeDatain classAbstractMultiReportWriter<Report>- Parameters:
data- the data to write- Returns:
- true if successfully written
-
-