From a session path, loads the settings file, finds the task and checks if extractors exist.
-Examples include ‘biased’, ‘habituation’, ‘training’, ‘ephys’, ‘mock_ephys’, and ‘sync_ephys’.
-Note this should only be used for legacy sessions, i.e. those without an experiment description
-file.
-
-
Parameters:
-
-
session_path (str, pathlib.Path) – The session path for which to determine the pipeline.
-
task_collection (str) – The session path directory containing the raw task data.
-
-
-
Returns:
-
The task extractor type, e.g. ‘biased’, ‘habituation’, ‘ephys’, or False if unknown.
Note that unlike get_session_extractor_type(), this function maps directly to the Bpod
trials extractor class name. This is hardware invariant and is purly to determine the Bpod only
trials extractor.
Extracts a training session from its path. NB: Wheel must be extracted first in order to
-extract trials.firstMovement_times.
-
-
Parameters:
-
-
session_path (str, pathlib.Path) – The path to the session to be extracted.
-
task_collection (str) – The subfolder containing the raw Bpod data files.
-
save (bool) – If true, save the output files to save_path.
-
bpod_trials (list of dict) – The loaded Bpod trial data. If None, attempts to load _iblrig_taskData.raw from
-raw_task_collection.
-
settings (dict) – The loaded Bpod settings. If None, attempts to load _iblrig_taskSettings.raw from
-raw_task_collection.
-
extractor_type (str) – The type of extraction. Supported types are {‘ephys’, ‘biased’, ‘biased_opto’,
-‘ephys_biased_opto’, ‘training’, ‘ephys_training’, ‘habituation’}. If None, extractor type
-determined from settings.
-
save_path (str, pathlib.Path) – The location of the output files if save is true. Defaults to <session_path>/alf.
-
-
-
Returns:
-
-
dict – The extracted trials data.
-
dict – The extracted wheel data.
-
list of pathlib.Path – The output files if save is true.
For the IBL ephys task, reads ephys binary file and extract:
-
video time stamps
-
-
-
-
-
Parameters:
-
session_type – the session type to extract, i.e. ‘ephys’, ‘training’ or ‘biased’. If
-
-
-
None the session type is inferred from the settings file.
-:param save: Bool, defaults to False
-:param kwargs: parameters to pass to the extractor
-:return: outputs, files
-
-
Parameters:
-
-
session_path (str, pathlib.Path) – The session path, e.g. ‘/path/to/subject/yyyy-mm-dd/001’.
-
sync_type (str) – The sync label from the experiment description file.
-
sync_collection (str) – The subdirectory containing the sync files.
-
save (bool) – If True, save the camera timestamp files to disk.
-
session_type (str) – (DEPRECATED) The session type, e.g. ‘ephys’.
-
**kwargs – Extra keyword args to pass to the camera extractor classes.
-
-
-
Returns:
-
-
list of numpy.array – List of extracted output data, i.e. the camera times.
-
list of pathlib.Path – The paths of the extracted data, if save = True
For the IBL ephys task, reads ephys binary file and extract:
-
sync
-
wheel
-
behaviour
-
-
-
-
These extract_all functions should be deprecated as they make assumptions about hardware
-parameters. Additionally the FpgaTrials class now automatically loads DAQ sync files, extracts
-the Bpod trials, and returns a dict instead of a tuple. Therefore this function is entirely
-redundant. See the examples for the correct way to extract NI DAQ behaviour sessions.
-
-
Parameters:
-
-
session_path (str, pathlib.Path) – The absolute session path, i.e. ‘/path/to/subject/yyyy-mm-dd/nnn’.
-
sync_collection (str) – The session subdirectory where the sync data are located.
-
save (bool) – If true, save the extracted files to save_path.
-
task_collection (str) – The location of the behaviour protocol data.
-
save_path (str, pathlib.Path) – The save location of the extracted files, defaults to the alf directory of the session path.
-
protocol_number (int) – The order that the protocol was run in.
-
**kwargs – Optional extractor keyword arguments.
-
-
-
Returns:
-
-
list – The extracted data.
-
list of pathlib.Path, None – If save is True, a list of file paths to the extracted data.