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

Extract waveform #1285

Open
Lorena-J opened this issue Jun 19, 2024 · 4 comments
Open

Extract waveform #1285

Lorena-J opened this issue Jun 19, 2024 · 4 comments

Comments

@Lorena-J
Copy link

Lorena-J commented Jun 19, 2024

Hello!!! I'm triyng to extract waveform information in my analysis and I'm using this code from the doc:

model = load_model(params) 
waveforms = model.get_cluster_spike_waveforms(cluster_id)
n_spikes, n_samples, n_channels_loc = waveforms.shape

But I'm not sure about the shape, I understand what n_pikes is but the n_samples and n_channels_loc I don't quite understand what they are.

@zm711
Copy link
Collaborator

zm711 commented Jun 20, 2024

n_samples are time. Recording equipment doesn't use seconds (typically) instead it uses a counter of rising ints. The conversion between time and sample is time = sample * sampling_rate.. Sometimes samples are also called frames (like you would imagine for a movie). n_channel_loc would be the channels that the spike is on.

so the idea of the matrix is:

you have a series of spikes and each spike is defined as electrical activity over time (n_samples) and over space (you need a waveform for each channel that you're interested in).

Does that make sense?

@Lorena-J
Copy link
Author

Lorena-J commented Jul 1, 2024

Yes, it make sense! I need to create a .txt file with the milivolts points of each spike in time_spike files. I need to create a .txt file with the data in millivolts that make up each spike detected in the spike_times file. That is, if the first spike detected is at time 1, I need to know the mv that make up that spike. I'm not quite sure what files I need to get this information.

@zm711
Copy link
Collaborator

zm711 commented Jul 2, 2024

Your code above looks to do it. This really depends on what you want to do. Again I have a preference for doing this specific type of work in spikeinterface because it gives you more filtering options and scaling options. In this case you read the data, but you're not necessarily in volts (mV or uV) so you can get the shape but maybe not the correct units.

@Lorena-J
Copy link
Author

Lorena-J commented Jul 3, 2024

Thank you very much for your help! now I have it all clear! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants