Skip to content

Commit

Permalink
Remove the need of template_similarity extension for autocorrelogram …
Browse files Browse the repository at this point in the history
…plot
  • Loading branch information
alejoe91 committed Nov 4, 2024
1 parent 7c953c2 commit 2faed13
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/spikeinterface/exporters/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def export_report(
"""
Exports a SI spike sorting report. The report includes summary figures of the spike sorting output.
What is plotted depends on what has been calculated. Unit locations and unit waveforms are always included.
Unit waveform densities, correlograms and spike amplitudes are plotted if `waveforms`, `correlograms`
and 'template_similarity', and `spike_amplitudes` have been computed for the given `sorting_analyzer`.
Unit waveform densities, correlograms and spike amplitudes are plotted if `waveforms`, `correlograms`,
and `spike_amplitudes` have been computed for the given `sorting_analyzer`.
Parameters
----------
Expand Down
8 changes: 7 additions & 1 deletion src/spikeinterface/widgets/autocorrelograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ class AutoCorrelogramsWidget(CrossCorrelogramsWidget):
# the doc is copied form CrossCorrelogramsWidget

def __init__(self, *args, **kargs):
CrossCorrelogramsWidget.__init__(self, *args, **kargs)
_ = kargs.pop("min_similarity_for_correlograms", 0.0)
CrossCorrelogramsWidget.__init__(
self,
*args,
**kargs,
min_similarity_for_correlograms=None,
)

def plot_matplotlib(self, data_plot, **backend_kwargs):
import matplotlib.pyplot as plt
Expand Down
3 changes: 2 additions & 1 deletion src/spikeinterface/widgets/crosscorrelograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class CrossCorrelogramsWidget(BaseWidget):
List of unit ids
min_similarity_for_correlograms : float, default: 0.2
For sortingview backend. Threshold for computing pair-wise cross-correlograms.
If template similarity between two units is below this threshold, the cross-correlogram is not displayed
If template similarity between two units is below this threshold, the cross-correlogram is not displayed.
For auto-correlograms plot, this is automatically set to None.
window_ms : float, default: 100.0
Window for CCGs in ms. If correlograms are already computed (e.g. with SortingAnalyzer),
this argument is ignored
Expand Down
4 changes: 2 additions & 2 deletions src/spikeinterface/widgets/unit_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
fig = self.figure
nrows = 2
ncols = 2
if sorting_analyzer.has_extension("correlograms") and sorting_analyzer.has_extension("template_similarity"):
if sorting_analyzer.has_extension("correlograms"):
ncols += 1
if sorting_analyzer.has_extension("waveforms"):
ncols += 1
Expand Down Expand Up @@ -172,7 +172,7 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
col_counter += 1
ax_waveform_density.set_ylabel(None)

if sorting_analyzer.has_extension("correlograms") and sorting_analyzer.has_extension("template_similarity"):
if sorting_analyzer.has_extension("correlograms"):
ax_correlograms = fig.add_subplot(gs[:2, col_counter])
AutoCorrelogramsWidget(
sorting_analyzer,
Expand Down

0 comments on commit 2faed13

Please sign in to comment.