Package adams.data.io.input
Class DeepLabCutCSVReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractReportReader<Report>
-
- adams.data.io.input.DeepLabCutCSVReader
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,FileFormatHandler,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<AbstractReportReader>,SizeOfHandler,Stoppable,StoppableWithFeedback,ReportReader<Report>,Serializable,Comparable
public class DeepLabCutCSVReader extends AbstractReportReader<Report>
Reads point annotations into multiple reports from DeepLabCut's CSV format.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-input <adams.core.io.PlaceholderFile> (property: input) The file to read and turn into a report. default: ${CWD}-prefix <java.lang.String> (property: prefix) The report field prefix used in the report. default: Point.
-file-regexp <adams.core.base.BaseRegExp> (property: fileRegExp) The regular expression that the file names must match in order to be turned into reports. default: .* more: https://docs.oracle.com/javase/tutorial/essential/regex/ https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_FILENAMEstatic StringKEY_INDIVIDUALSstatic StringKEY_LABELSprotected BaseRegExpm_FileRegExpthe regexp the files must match.protected Stringm_Prefixthe prefix of the points in the report.-
Fields inherited from class adams.data.io.input.AbstractReportReader
m_Input, m_Stopped
-
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 DeepLabCutCSVReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected intdetermineParentID(Report report)Tries to determine the parent ID for the current report.StringfileRegExpTipText()Returns the tip text for this property.BaseRegExpgetFileRegExp()Returns the regexp the file names must match.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension(s) of the format.StringgetPrefix()Returns the field prefix used in the report.StringglobalInfo()Returns a string describing the object.ReportnewInstance()Returns a new instance of the report class in use.StringprefixTipText()Returns the tip text for this property.protected List<Report>readData()Performs the actual reading.voidsetFileRegExp(BaseRegExp value)Sets the regexp the file names must match.voidsetPrefix(String value)Sets the field prefix used in the report.-
Methods inherited from class adams.data.io.input.AbstractReportReader
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getInput, getReaders, inputTipText, isStopped, postRead, read, reset, setInput, shallowCopy, shallowCopy, stopExecution
-
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
-
-
-
-
Field Detail
-
KEY_FILENAME
public static final String KEY_FILENAME
- See Also:
- Constant Field Values
-
KEY_INDIVIDUALS
public static final String KEY_INDIVIDUALS
- See Also:
- Constant Field Values
-
KEY_LABELS
public static final String KEY_LABELS
- See Also:
- Constant Field Values
-
m_Prefix
protected String m_Prefix
the prefix of the points in the report.
-
m_FileRegExp
protected BaseRegExp m_FileRegExp
the regexp the files must match.
-
-
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 classAbstractReportReader<Report>
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Parameters:
value- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFileRegExp
public void setFileRegExp(BaseRegExp value)
Sets the regexp the file names must match.- Parameters:
value- the expression
-
getFileRegExp
public BaseRegExp getFileRegExp()
Returns the regexp the file names must match.- Returns:
- the expression
-
fileRegExpTipText
public String fileRegExpTipText()
Returns the tip text for this property.- 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 classAbstractReportReader<Report>- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Specified by:
getFormatExtensionsin classAbstractReportReader<Report>- Returns:
- the extension(s) (without the dot!)
-
determineParentID
protected int determineParentID(Report report)
Tries to determine the parent ID for the current report.- Specified by:
determineParentIDin classAbstractReportReader<Report>- Parameters:
report- the report to determine the ID for- Returns:
- the parent database ID, -1 if it cannot be determined
-
newInstance
public Report newInstance()
Returns a new instance of the report class in use.- Specified by:
newInstancein classAbstractReportReader<Report>- Returns:
- the new (empty) report
-
readData
protected List<Report> readData()
Performs the actual reading.- Specified by:
readDatain classAbstractReportReader<Report>- Returns:
- the reports that were read
-
-