Loading Video Data

Extracted DLC features and motion energy from raw video data

Relevant Alf objects

  • bodyCamera

  • leftCamera

  • rightCamera

  • licks

  • ROIMotionEnergy


from one.api import ONE

one = ONE()
eid = '4ecb5d24-f5cc-402c-be28-9d0f7cb14b3a'

label = 'right' # 'left', 'right' or 'body'

video_features = one.load_object(eid, f'{label}Camera', collection='alf')

More details

Useful modules

Exploring video data

Example 1: Filtering dlc features by likelihood threshold

# Set values with likelihood below chosen threshold to NaN
from brainbox.behavior.dlc import likelihood_threshold

dlc = likelihood_threshold(video_features['dlc'], threshold=0.9)

Example 2: Compute speed of dlc feature

from brainbox.behavior.dlc import get_speed

# Compute the speed of the right paw
feature = 'paw_r'
dlc_times = video_features['times']
paw_r_speed = get_speed(dlc, dlc_times, label, feature=feature)

Example 3: Plot raster of lick times around feedback event

licks = one.load_object(eid, 'licks', collection='alf')
trials = one.load_object(eid, 'trials', collection='alf')

from brainbox.behavior.dlc import plot_lick_raster
fig = plot_lick_raster(licks['times'], trials.to_df())

Other relevant examples