Open SusanL82 opened 1 year ago
I've ended up getting waveforms via get_traces, which seems to work fine (see below). I'm still curious if something similar could be done with the waveform extractor (and profit from some of the extra features that the waveform extractor has).
allWFs = np.zeros([32,4,len(TetPeaks['sample_index'])], dtype = 'int16')
for p in tqdm(range(len(TetPeaks['sample_index'])), desc="collecting waveforms"):
sf = TetPeaks['sample_index'][p] - prepeak
ef = TetPeaks['sample_index'][p] + postpeak
thisWF = TheseSigs.get_traces(segment_index = None, start_frame = sf, end_frame = ef)
#write only complete spike waveforms (might skip last spike if too short)
if np.size(thisWF,0) == 32:
allWFs[:,:,p] = thisWF
Hi Susan, your need is a corner case but this is should be doable.
Question 1: you could open an issue in https://github.com/NeuralEnsemble/python-neo Apparently we have an issue with overflow : internally some counter that could int32 should int64 or somethign similar.
Question 2 : you sedonc soultion is totally valid. We have similar machinery to do this in parralel and maybe faster in spikeinterface for this you should have a look in https://github.com/SpikeInterface/spikeinterface/blob/main/src/spikeinterface/core/waveform_tools.py
importantly : detect_peaks(TheseSigs, method='by_channel', )
you are detecting peaks by channels. If you are using tetrode or silicon probe a spike can be seen on sevral channel. To avoid multiple detection of the same spike but diffrents channel you should use detect_peaks(TheseSigs, method='locally_exclusive', radius_um=XXX )
Good evening (and apologies for yet another question),
I am trying to extract spikes from axona recordings and to save the spike times and waveforms to some filetype that I can then read into matlab. There, I hope to use the Neuralynx utilities to write the spikes to an .ntt file that we can then use for manual clustering in SpikeSort3D. We want to do so that we can directly compare our manual to automatic scores, but also because the manual clustering is very fast.
I have two question about the first step:
When I run detect_peaks (see below), I get the following warning:
What does this mean, and should I worry about it?
I would like to get waveforms on all 4 tetrode channels for the detected peaks. The waveform extractor seems to require a sorted recording. Should I try to collect small sections of my traces with get_traces instead (e.g. centered on the detected peak)?
Thanks for your help, Susan