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')
/home/runner/Downloads/ONE/openalyx.internationalbrainlab.org/hoferlab/Subjects/SWC_043/2020-09-21/001/alf/#2022-01-31#/_ibl_rightCamera.dlc.pqt: 100%|██████████| 83.0M/83.0M [00:02<00:00, 35.2MB/s]
/home/runner/Downloads/ONE/openalyx.internationalbrainlab.org/hoferlab/Subjects/SWC_043/2020-09-21/001/alf/_ibl_rightCamera.features.pqt: 100%|██████████| 9.92M/9.92M [00:00<00:00, 12.6MB/s]
/home/runner/Downloads/ONE/openalyx.internationalbrainlab.org/hoferlab/Subjects/SWC_043/2020-09-21/001/alf/_ibl_rightCamera.times.npy: 100%|██████████| 4.82M/4.82M [00:00<00:00, 11.0MB/s]
/home/runner/Downloads/ONE/openalyx.internationalbrainlab.org/hoferlab/Subjects/SWC_043/2020-09-21/001/alf/#2022-01-31#/rightCamera.ROIMotionEnergy.npy: 100%|██████████| 4.82M/4.82M [00:00<00:00, 8.10MB/s]

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())
/home/runner/Downloads/ONE/openalyx.internationalbrainlab.org/hoferlab/Subjects/SWC_043/2020-09-21/001/alf/licks.times.npy: 100%|██████████| 498k/498k [00:00<00:00, 1.49MB/s]
../_images/notebooks_external_loading_video_data_14_1.png

Other relevant examples

  • COMING SOON