ibl_alignment_gui.plugins.cluster_features
Functions
Triggered when a cluster in a scatter plot is clicked. |
|
Compute time vectors for autocorrelogram and template waveform plots. |
|
Compute the autocorrelogram for a specific cluster. |
|
Retrieve the template waveform for a specific cluster. |
|
Set up the Cluster Features plugin. |
Classes
A popup qt window per cluster. |
|
Manager for multiple cluster popups in the GUI. |
- class ibl_alignment_gui.plugins.cluster_features.ClusterPopup(title, view, data=None)[source]
Bases:
PopupWindowA popup qt window per cluster.
Shows plots of the cluster autocorrelogram and template waveform.
- Parameters:
title (str) – The title of the popup window.
data (dict or None) – A dictionary containing data to be plotted in the popup.
parent (QtWidgets.QMainWindow or None) – The parent window of the popup.
- class ibl_alignment_gui.plugins.cluster_features.ClusterPopupManager(controller)[source]
Bases:
objectManager for multiple cluster popups in the GUI.
- parent_view
The main window of the application.
- Type:
QtWidgets.QMainWindow
- cluster_popups
A list of currently open cluster popups.
- Type:
list
- popup_status
Status indicating whether popups are minimised or shown.
- Type:
bool
- add_popup(shank, clust_no, config, data)[source]
Add a new cluster popup to the manager and set up its signals.
- Parameters:
shank (str) – The name of shank
clust_no (int) – The cluster number.
config (str) – The config of the shank
data (dict) – A dict containing data to be plotted in the popup.
- Return type:
None
- minimise_popups()[source]
Toggle between minimizing and restoring all cluster popups.
- Return type:
None
- popup_closed(popup)[source]
Triggered when a popup is closed by the user.
- Parameters:
popup (ClusterPopup) – The cluster popup that was closed.
- Return type:
None
- ibl_alignment_gui.plugins.cluster_features.callback(controller, items, _, point)[source]
Triggered when a cluster in a scatter plot is clicked.
Computes autocorrelation and template waveform for the selected cluster and opens a popup showing the plots.
- Parameters:
controller (AlignmentGUIController) – The main application controller.
items (ShankController) – The shank controller containing cluster data.
point (pg.ScatterPlotItem) – The clicked scatter item in the scatter plot.
- Return type:
None
- ibl_alignment_gui.plugins.cluster_features.compute_timescales(plot_loader)[source]
Compute time vectors for autocorrelogram and template waveform plots.
- Parameters:
plot_loader (PlotLoader) – The plot loader object containing spike and cluster data.
- Return type:
tuple[ndarray,ndarray]- Returns:
t_autocorr (np.ndarray) – The time vector for autocorrelogram (ms).
t_template (np.ndarray) – The time vector for template waveform (ms).
- ibl_alignment_gui.plugins.cluster_features.get_autocorr(plot_loader, clust_idx)[source]
Compute the autocorrelogram for a specific cluster.
- Parameters:
plot_loader (PlotLoader) – The plot loader object containing spike and cluster data.
clust_idx (int) – Index of the cluster
- Return type:
tuple[ndarray,int]- Returns:
autocorr (np.ndarray) – The autocorrelogram of the selected cluster
clust_id (int) – The cluster id of the selected cluster
- ibl_alignment_gui.plugins.cluster_features.get_template_wf(plot_loader, clust_idx)[source]
Retrieve the template waveform for a specific cluster.
- Parameters:
plot_loader (PlotLoader) – The plot loader object containing spike and cluster data.
clust_idx (int) – Index of the cluster
- Returns:
template_wf – The template waveform of the selected cluster
- Return type:
np.ndarray