ibl_alignment_gui.plugins.cluster_features

Functions

callback

Triggered when a cluster in a scatter plot is clicked.

compute_timescales

Compute time vectors for autocorrelogram and template waveform plots.

get_autocorr

Compute the autocorrelogram for a specific cluster.

get_template_wf

Retrieve the template waveform for a specific cluster.

setup

Set up the Cluster Features plugin.

Classes

ClusterPopup

A popup qt window per cluster.

ClusterPopupManager

Manager for multiple cluster popups in the GUI.

class ibl_alignment_gui.plugins.cluster_features.ClusterPopup(title, view, data=None)[source]

Bases: PopupWindow

A 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.

setup()[source]

Configure the plots inside the popup window.

Return type:

None

class ibl_alignment_gui.plugins.cluster_features.ClusterPopupManager(controller)[source]

Bases: object

Manager 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

close_popups()[source]

Close all cluster popups and reset the list.

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

popup_entered(popup)[source]

Triggered when the mouse enters a popup.

Return type:

None

popup_left()[source]

Triggered when the mouse leaves a popup.

Return type:

None

reset()[source]

Triggered when the main GUI is closed. Closes all popups and resets the manager.

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

ibl_alignment_gui.plugins.cluster_features.setup(controller)[source]

Set up the Cluster Features plugin.

Adds a submenu to the main GUI for managing the cluster popups.

Parameters:

controller (AlignmentGUIController) – The main application controller.

Return type:

None