ibllib.qc.dlc
Pose estimation QC This module runs a list of quality control metrics on the pose estimation traces (DLC or LP).
- Example - Run DLC QC
qc = DlcQC(eid, ‘left’, download_data=True) qc.run()
- Example - Run LP QC
qc = LpQC(eid, ‘left’, download_data=True) qc.run()
- Question:
We’re not extracting the audio based on TTL length. Is this a problem?
Functions
Run DLC QC for all cameras Run the DLC QC for left, right and body cameras. |
Classes
A class for computing DLC QC metrics |
|
A class for computing LP QC metrics |
|
A parent class for computing camera Pose estimation QC metrics |
- class PoseQC(session_path_or_eid, side, tracker, ignore_checks=[], **kwargs)[source]
Bases:
QC
A parent class for computing camera Pose estimation QC metrics
- bbox = {'body': {'xrange': range(201, 500), 'yrange': range(81, 330)}, 'left': {'xrange': range(301, 700), 'yrange': range(181, 470)}, 'right': {'xrange': range(301, 600), 'yrange': range(110, 275)}}
- load_data(download_data: bool = None) None [source]
Extract the data from data files Extracts all the required task data from the data files.
- Data keys:
camera_times (float array): camera frame timestamps extracted from frame headers
- pose_coords (dict): keys are the points traced by pose estimation, items are x-y
coordinates of these points over time, those with likelihood <0.9 set to NaN
- Parameters:
download_data – if True, any missing raw data is downloaded via ONE.
- run(update: bool = False, **kwargs) -> (<class 'str'>, <class 'dict'>)[source]
Run DLC QC checks and return outcome
- Parameters:
update – if True, updates the session QC fields on Alyx
download_data – if True, downloads any missing data if required
- Returns:
overall outcome as a str, a dict of checks and their outcomes
- check_time_trace_length_match()[source]
Check that the length of the DLC traces is the same length as the video.
- check_trace_all_nan()[source]
Check that none of the dlc traces, except for the ‘tube’ traces, are all NaN.
- class DlcQC(session_path_or_eid, side, ignore_checks=['check_pupil_diameter_snr'], **kwargs)[source]
Bases:
PoseQC
A class for computing DLC QC metrics
- class LpQC(session_path_or_eid, side, ignore_checks=[], **kwargs)[source]
Bases:
PoseQC
A class for computing LP QC metrics
- run_all_qc(session, cameras=('left', 'right', 'body'), tracker='dlc', one=None, **kwargs)[source]
Run DLC QC for all cameras Run the DLC QC for left, right and body cameras.
- Parameters:
session – A session path or eid.
update – If True, QC fields are updated on Alyx.
cameras – A list of camera names to perform QC on.
tracker – pose estimation algorithm to run QC on. Options are {‘dlc’, ‘lightningPose’}
- Returns:
dict of DlcQC objects