Loading Video Data

Extracted DLC features and motion energy from raw video data

Relevant Alf objects

  • bodyCamera

  • leftCamera

  • rightCamera

  • licks

  • ROIMotionEnergy

Loading

[1]:
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

[2]:
# 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

[3]:
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

[5]:
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())
../_images/notebooks_external_loading_video_data_14_0.png

Other relevant examples

  • COMING SOON