ibl_alignment_gui.handlers.probe_handler
Classes
Abstract base class for handling alignment and data loading for a probe. |
|
ProbeHandler where data from two channel maps has been recorded on the shanks. |
|
Local file system implementation of ProbeHandler. |
|
Local file system implementation of ProbeHandler that uses a yaml file. |
|
ONE implementation of ProbeHandler. |
- class ibl_alignment_gui.handlers.probe_handler.ProbeHandler(brain_atlas)[source]
Bases:
ABCAbstract base class for handling alignment and data loading for a probe.
This class provides access to loader methods that handle different aspects of the alignment process. Where applicable the probe is split into shanks and each shank is handled separately.
It can also handle multiple configurations for each shank, for example if two different channel maps are used to record data.
- Parameters:
brain_atlas (AllenAtlas) – An AllenAtlas instance.
- property current_idx: int
Return the current index of the alignment stored in the buffer for the selected shank.
- Returns:
The index of the current alignment
- Return type:
int
- property feature_keys: list[str]
Find the list of available feature plot keys across all shanks and configurations.
- Returns:
A tuple of unique probe plot keys.
- Return type:
tuple
- get_config(idx)[source]
Select a configuration by index.
- Parameters:
idx (int) – Index in the list of possible configurations.
- Return type:
None
- get_plot(shank, plot, key, config=None)[source]
Access a specific plot for a specific shank and configuration.
- Parameters:
shank (str) – The shank label to access.
plot (str) – The plot type to access. One of ‘image’, ‘scatter’, ‘line’, ‘probe’ or ‘slice’
key (str) – The plot key to access.
config (str) – The configuration to access. If None, uses the default configuration.
- Returns:
The requested plot, or None if not found.
- Return type:
Any
- get_plot_keys(plot)[source]
Find a list of available keys across all shanks and configurations for a given plot type.
- Parameters:
plot (
str) – The plot type to get the keys for. One of ‘image’, ‘scatter’, ‘line’, ‘probe’ or ‘slice’- Returns:
A list of unique plot keys.
- Return type:
list
- get_previous_alignments()[source]
Get previous alignments for the selected shank.
Always returns the alignments from the default configuration.
- Returns:
Previous alignments for the selected shank
- Return type:
dict
- get_starting_alignment(idx)[source]
Set the index of the starting alignment for the selected shank and each configuration.
- Parameters:
idx (int) – The index of the previous alignment to load.
- Return type:
None
- property image_keys: list[str]
Find the list of available image plot keys across all shanks and configurations.
- Returns:
A list of unique image plot keys.
- Return type:
list
- property line_keys: list[str]
Find the list of available line plot keys across all shanks and configurations.
- Returns:
A list of unique line plot keys.
- Return type:
list
- load_previous_alignments()[source]
Load previous alignments for the selected shank.
Always returns the alignments from the default configuration.
- Returns:
Previous alignments for the selected shank.
- Return type:
dict
- next_idx()[source]
Return the index of the next available alignment for the selected shank.
- Returns:
The index of the next available alignment stored in th circular buffer.
- Return type:
int
- static normalize_shank_label(shank_label)[source]
Normalize a shank label to the form ‘probe0X’.
- Parameters:
shank_label (str) – Input shank label.
- Returns:
Normalized label.
- Return type:
str
- prev_idx()[source]
Return the index of the previously available alignment for the selected shank.
- Returns:
The index of the previous available alignment stored in th circular buffer.
- Return type:
int
- property probe_keys: list[str]
Find the list of available probe plot keys across all shanks and configurations.
- Returns:
A tuple of unique probe plot keys.
- Return type:
tuple
- property scatter_keys: list[str]
Find the list of available scatter plot keys across all shanks and configurations.
- Returns:
A list of unique scatter plot keys.
- Return type:
list
- set_init_alignment()[source]
Initialise the alignment for the selected shank and each configuration.
- Return type:
None
- property slice_keys: list[str]
Find the list of available slice plot keys across all shanks and configurations.
- Returns:
A list of unique slice plot keys.
- Return type:
list
- property total_idx: int
Return the total index of the alignments stored in the buffer for the selected shank.
- Returns:
The total number of alignments stored in the circular buffer
- Return type:
int
- class ibl_alignment_gui.handlers.probe_handler.ProbeHandlerCSV(csv_file, one=None, brain_atlas=None)[source]
Bases:
ProbeHandlerProbeHandler where data from two channel maps has been recorded on the shanks.
The data for the dense configuration is available via ONE whereas the data for the quarter configuration is only available on the local file system. Reads in a csv file that contains information about where to read the relevant data from.
- get_sessions(idx)[source]
Find all probes for a given session.
Note if multi-shank data it will return probe00 rather than probe00a, the individual shank is chosen using the shank dropdown.
- Parameters:
idx (idx) – The index of the chosen subject
- Returns:
All probes with spikesorting data for the chosen session
- Return type:
np.ndarray
- get_shanks(idx)[source]
Find all shanks for a given probe and initialise the loaders.
- Parameters:
idx (idx) – The index of the chosen probe
- Returns:
All shanks for the chosen probe
- Return type:
np.ndarray
- get_subjects()[source]
Find all sessions with spike sorting data.
- Returns:
All sessions with spikesorting data.
- Return type:
np.ndarray
- class ibl_alignment_gui.handlers.probe_handler.ProbeHandlerLocal(brain_atlas=None)[source]
Bases:
ProbeHandlerLocal file system implementation of ProbeHandler.
For this ProbeHandler, all ephys and alignment data must be stored in a single folder on disk.
- class ibl_alignment_gui.handlers.probe_handler.ProbeHandlerLocalYaml(yaml_file, brain_atlas=None)[source]
Bases:
ProbeHandlerLocal file system implementation of ProbeHandler that uses a yaml file.
The yaml file contains information about where to read the relevant data from.
- get_shanks(_)[source]
Initialise the shanks based on the yaml file.
If only one probe label is given we load in the geometry to see if it is a multi-shank recording. Otherwise, we assume the yaml has specified all shanks and these are treated individually.
- Return type:
list[str]
- class ibl_alignment_gui.handlers.probe_handler.ProbeHandlerONE(one=None, brain_atlas=None, spike_collection=None)[source]
Bases:
ProbeHandlerONE implementation of ProbeHandler.
For this ProbeHandler all ephys and alignment data is downloaded and accessed via ONE and Alyx.
The data for all shanks on a probe will be loaded at once.
- Parameters:
one (ONE) – An ONE instance used to upload results to Alyx
brain_atlas (AllenAtlas) – An AllenAtlas object.
spike_collection (str, optional) – Spike sorting algorithm to load (e.g. ‘pykilosort’, ‘iblsorter’).
- get_session_probe_name(ins)[source]
Make a string containing the combination of session information and probe name.
Removes the shank identifiers from the probe names.
- Parameters:
ins (dict) – A dict containing insertion data
- Returns:
A string with the session info and probe name
- Return type:
str
- get_sessions(idx)[source]
Find all probes for a given subject.
Note if multi-shank data it will return probe00 rather than probe00a, the individual shank is chosen using the shank dropdown.
- Parameters:
idx (idx) – The index of the chosen subject
- Returns:
All probes with spikesorting data for the chosen subject
- Return type:
np.ndarray
- get_shanks(idx)[source]
Find all shanks for a given probe and initialise the loaders.
- Parameters:
idx (idx) – The index of the chosen probe
- Returns:
All shanks for the chosen probe
- Return type:
np.ndarray