Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpikeData "waveform" property #238

Closed
KatharineShapcott opened this issue Mar 16, 2022 · 7 comments
Closed

SpikeData "waveform" property #238

KatharineShapcott opened this issue Mar 16, 2022 · 7 comments
Labels
Feature Request A concrete request (as detailed as possible) to either add or change functionality.

Comments

@KatharineShapcott
Copy link
Contributor

Fieldtrip's spike structure has an optional "waveform" field. It would be useful to have a similar "waveform" property in the SpikeData class so that the type of spikes (e.g. inhibitory or excitatory) can be identified.

Quote from https://www.fieldtriptoolbox.org/tutorial/spike/

"The first dimension of spike.waveform{i} is ‘leads’. For tetrode recordings, multiple leads per electrode are available, in which case the first dimension of spike.waveform{i} would have been of size 4.
The second dimension of waveform contains the samples. In this case one sample corresponds to 1/40000 seconds.
The third dimension of spike.waveform{i} equals the length of spike.timestamp{i}, such that a waveform is present for every spike (‘spike’ dimension)."

We would only need this for sorted spikes though, which won't happen for a few more months.

@KatharineShapcott KatharineShapcott added the Feature Request A concrete request (as detailed as possible) to either add or change functionality. label Mar 16, 2022
@tensionhead
Copy link
Contributor

Ah ok I see, thx @KatharineShapcott for bringing this up! @joschaschmiedt is that something you could take care of?

@tensionhead tensionhead added the More info needed More information is needed from the person who reported this. label Jan 3, 2023
@KatharineShapcott
Copy link
Contributor Author

Seems like other well used formats are also three dimensional.

Now we can retrieve waveforms per unit on-the-fly. The waveforms shape is (num_spikes, num_sample, num_channel):

https://spikeinterface.readthedocs.io/en/latest/modules/core/plot_4_waveform_extractor.html

In this case the extra dimension is channel which I think is definitely more general than lead

@tensionhead
Copy link
Contributor

mmh.. what is num_spikes and num_sample?

@KatharineShapcott
Copy link
Contributor Author

num_spikes is the total number of spikes, num_sample is the number of samples that makes up the waveform

@KatharineShapcott
Copy link
Contributor Author

They have a seperate storage for each unit (or channel in our case) though. This might makes sense since the most common operation is to mean or median across the unit and plot the average waveform. But it will mess up all our indexing

@dfsp-spirit dfsp-spirit mentioned this issue Feb 17, 2023
4 tasks
@dfsp-spirit
Copy link
Collaborator

This is implemented in PR437.

@dfsp-spirit dfsp-spirit removed the More info needed More information is needed from the person who reported this. label Feb 20, 2023
@tensionhead
Copy link
Contributor

Done with #437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request A concrete request (as detailed as possible) to either add or change functionality.
Projects
None yet
Development

No branches or pull requests

3 participants