CrowsettaLabelConverter#

class ethograph.labels.converters.CrowsettaLabelConverter(file_path, format_name, name_to_id, individual='ind0')[source]#

Bases: LabelConverter

Convert crowsetta annotation files to ethograph intervals.

Crowsetta labels are already in file-local time, so no trial table is needed for time conversion. If a trials_df is provided the first trial id is attached; otherwise trial=1.

Methods

extract([trials_df])

Return an all-labels DataFrame (with trial column).

resolve_labels(source_path, trial_ids[, ...])

Load labels with fallback: existing TSV → extract from source → empty.

extract(trials_df=None)[source]#

Return an all-labels DataFrame (with trial column).

Parameters:

trials_df (pd.DataFrame | None) – Must contain trial, start_time, stop_time columns. Required for sources with global timestamps (NWB, pynapple).

Return type:

pd.DataFrame