Loading Video Data
Extracted DLC features and motion energy from raw video data
Relevant Alf objects
bodyCamera
leftCamera
rightCamera
licks
ROIMotionEnergy
Loading
[2]:
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')
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/one/util.py:543: ALFWarning: Multiple revisions: "2022-01-31", ""
warnings.warn(f'Multiple revisions: {rev_list}', alferr.ALFWarning)
More details
Useful modules
Exploring video data
Example 1: Filtering dlc features by likelihood threshold
[3]:
# 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
[4]:
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
[6]:
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
COMING SOON