API Documentation

API reference for the BirdSongToolbox module.

Table of Contents

Import Data Objects

Classes that import data and return objects that manage both neural and behavioral data and its corresponding metadata.

Chunked Data Object

The ImportData class imports the Chunked Data format and returns it as a object for analysis.

import_data.ImportData(bird_id, session[, …])

Imports Data Specified by user into a Object Oriented Structure

Epoched Data Object

The Import_PrePd_Data object imports the Epoched Data format.

ImportClass.Import_PrePd_Data(bird_id, sess_name)

Import Prepared (PrePd) Data and its accompanying meta-data into the workspace for analysis

File I/O

There Are internal Mechanisms for loading and saving files.

Preprocessing: Chunks

Preprocessing functions for the Chunked Data Format must be selected based on the structure of the dataset used. Always check the shape information in the function documentation.

Rereference

common_average_reference(chunk_neural, …)

Common Average References all Epochs(Chunk)

Filter

bandpass_filter(neural_data, fs, l_freq, h_freq)

Bandpass Filter Neural Data

bandpass_filter_epochs(epoch_neural_data, …)

Bandpass Filter Epochs(Chunks)

multi_bpf_epochs(epoch_neural_data, fs, …)

Run multiple bandpass filters on multiple neural data Epochs(Chunks)

multi_bpf(chunk_neural_data, fs, l_freqs, …)

Run multiple bandpass filters on one neural data Epoch(Chunks)

Hilbert Transform

hilbert_module(neural_data, output[, smooth])

Use the Hilbert Transform to get either the Amplitude or Phase of the Input Neural Data

Preprocessing: Epochs

The Epoched data format uses object-oriented interface which primarily uses the Pipeline class. You must first make a Pipeline instance, which is a hard copy of the imported data. You can now pre-process the data in place using the preprocessing methods. Once you have completed the pipeline you can close the pipe which will prevent the data from being preprocessed further by accident.

Pipeline Object

Pipeline(Imported_Data)

Class for Pre-Processing Neural Data

Song Behavior

Suite of Functions for working with Song Behavioral Labels. To use these functions on the handlabels you must first convert the labels into a different format using this helper function.

get_chunk_handlabels(handlabels_list)

Get all of the Hand-labels from all of the ‘labels’ tiers from the handlabels_list

Basic Label Extraction

The most basic operations to operate on the handlabels are as follows.

label_focus_chunk(focus, labels, starts)

Create a list of every instance of the User defined User Label (Focus on One Label)

label_group_chunk(Focuses, labels, starts)

Group Selected labels together into One Label e.g.

label_extractor(all_labels, starts, …)

Extracts all of the Neural Data Examples of User Selected Labels and return them in the designated manner.

Contextual Labels

More advance Contextual functions can be added to the handlabels using a properly initialized instance of this object.

ContextLabels(bout_states, bout_transitions, …)

Class which adds additional labels on top of the handlables to allow for flexible selection of events using context

Contextual Label Operations

label_focus_context(focus, labels, starts, …)

Create a list of every instance of the User defined User Label (Focus on One Label)

get_motif_identifier(focus, context, labels)

param focus

list

Long Silence Finder Helpful for finding long periods of silence

long_silence_finder(silence, all_labels, …)

Checks if the Duration of the Silence Label is longer than the window and sets start equal to the middle of event

Restructure Data using Behavior

Using a selection of behavior event times you can restructure neural or behavioral data to run event related analysis.

get_event_related_nd(data, indices, fs, window)

Take an input ndarray of time series data, vector of event indices, and window sizes, and return a nd matrix of windowed trials around the event indices.

get_event_related(data, indices, fs, window)

Get all Instances of 1 Label from all Chunks

event_clipper(data, label_events, fs, window)

Get all of the Instances for all Labels given for one set of chunks

event_clipper_freqs(filt_data, label_events, …)

Get all of the Instances for all Labels given for all frequency bands for one set of chunks

get_event_related_nd_chunk(chunk_data, …)

Run the get_event_related_nd across all chunks

event_clipper_nd(data, label_events, fs, window)

Get all of the Instances for all Labels given for one set of chunks

event_shape_correction(chunk_events, …)

Reshape the output of get_event_related_nd_chunk to be shape of [Instances]->( Freqs, Channels, Samples) or [Instances]->(Channels, Samples)