ethograph.labels.converters#

External format converters: crowsetta, NWB, pynapple, and other label I/O.

Classes

LabelConverter

Base class for converting external label sources to ethograph intervals.

CrowsettaLabelConverter

Convert crowsetta annotation files to ethograph intervals.

PynappleLabelConverter

Extract labels from pynapple IntervalSet objects.

Functions

build_mapping_from_labels

Build a name->id mapping from a list of unique string labels.

crowsetta_to_intervals

Convert a crowsetta annotation file to an intervals DataFrame.

extract_crowsetta_labels

Extract unique string labels from a crowsetta annotation file.

resolve_crowsetta_mapping

Check existing mapping against crowsetta labels; create new if needed.

write_mapping_file

Write a mapping file in '<id> <name>' format.