spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

Allow `export_report` to run without waveforms

Open chrishalcrow opened this issue 1 year ago • 4 comments

Small edit to export_report so that it will generate a report without waveforms.

When we're being speedy, we often don't compute or don't copy over waveforms. This PR just changes export_report so that it does/doesn't include the UnitWaveformDensityMapWidget if the sorting_analyzer does/doesn't have waveforms computed.

A unit report without waveforms:

4

computed using

import spikeinterface.full as si
rec, sort = si.generate_ground_truth_recording()
sa = si.create_sorting_analyzer(recording=rec, sorting=sort)
sa.compute(["random_spikes",  "templates", "spike_amplitudes", "correlograms", "template_similarity"])
si.export_report(sorting_analyzer=sa, output_folder="my_report")

chrishalcrow avatar Oct 21 '24 09:10 chrishalcrow

I think this is an improvement. Another request we should think about is to have more flexibility in selecting what to plot in general. There are complaints about the slowness of making the summary when you only want some features to be saved. So something like this could be extended to help speed things up for people.

zm711 avatar Oct 21 '24 20:10 zm711

Good idea. thanks Chris.

samuelgarcia avatar Oct 22 '24 07:10 samuelgarcia

I think this is an improvement. Another request we should think about is to have more flexibility in selecting what to plot in general. There are complaints about the slowness of making the summary when you only want some features to be saved. So something like this could be extended to help speed things up for people.

Mmm, good idea. So at the moment we include 5 widgets. Your suggestion would be to allow the user to select which ones they'd like, and we format the report appropriately? Sounds doable (and extendable for other widgets!) in another PR.

chrishalcrow avatar Oct 22 '24 08:10 chrishalcrow

in another PR.

agreed. :)

zm711 avatar Oct 23 '24 13:10 zm711

Thanks @JoeZiminski - will take a look on Monday!

chrishalcrow avatar Oct 25 '24 14:10 chrishalcrow

All updated - also fixed a column counting issue that occurred when correlograms and spike_amplitudes were on, but waveforms were off. Also added in a check for template_similarity, which is needed to compute correlograms it seems.

chrishalcrow avatar Oct 29 '24 12:10 chrishalcrow

template_similarity, which is needed to compute correlograms it seems.

yeah the correlograms are only calculated for templates deemed similar enough. That's annoyed me in the past, but I understand why it is there.

zm711 avatar Oct 29 '24 12:10 zm711

Hello, could this be merged please(@samuelgarcia )? Just to sum up, here is every possible report output, made from

import spikeinterface.full as si
rec, sort = si.generate_ground_truth_recording(durations=[60])
sa = si.create_sorting_analyzer(recording=rec, sorting=sort)

then...

sa.compute(["random_spikes", "unit_locations","templates","template_similarity"]) 0

sa.compute(["random_spikes", "unit_locations", "templates","template_similarity", "correlograms"]) 0

sa.compute(["random_spikes", "unit_locations", "templates","template_similarity", "waveforms"]) 0

sa.compute(["random_spikes", "unit_locations", "templates","template_similarity", "spike_amplitudes"]) 0

sa.compute(["random_spikes", "unit_locations", "templates", "spike_amplitudes", "correlograms"]) (note: no template similarity => no correlograms!) 0

sa.compute(["random_spikes", "unit_locations","templates","template_similarity", "waveforms", "correlograms"]) 0

sa.compute(["random_spikes", "unit_locations","templates","template_similarity", "waveforms", "spike_amplitudes"]) 0

sa.compute(["random_spikes", "unit_locations","templates","template_similarity", "waveforms", "correlograms", "spike_amplitudes"]) 0

chrishalcrow avatar Nov 04 '24 14:11 chrishalcrow

@chrishalcrow @zm711 I pushed an update that removes the need to compute template_similarity, which is counter-intuituve. In fact, this is only needed for cross-correlograms, but not for auto-correlogram plots.

Tested on my side and works like a charm!

alejoe91 avatar Nov 04 '24 15:11 alejoe91

@chrishalcrow @zm711 I pushed an update that removes the need to compute template_similarity, which is counter-intuituve. In fact, this is only needed for cross-correlograms, but not for auto-correlogram plots.

Tested on my side and works like a charm!

Beautiful - works on my side too.

chrishalcrow avatar Nov 04 '24 15:11 chrishalcrow