How to use getWaveForms.m
danielpollak opened this issue · 1 comments
danielpollak commented
I'm trying to use getWaveForms.m and I can't figure out how to make it run.
In particular, I'm getting tripped up filling out the following parameters:
gwfparams.spikeTimes = [2,3,5,7,8,9]; % Vector of cluster spike times (in samples) same length as .spikeClusters
gwfparams.spikeClusters = [1,2,1,1,1,2]; % Vector of cluster IDs (Phy nomenclature) same length as .spikeTimes
I have no idea what the comments here mean, and I'd appreciate any help.
danielpollak commented
I figured it out! Here's the code I use to run getWaveForms.m. It relies on a function called loadKSdir, found in this very repository here.
FRAC = 0.10; % fraction of all spikes to sample from
dataDir = pwd;
sp = loadKSdir(dataDir);
gwfparams.sr = sp.sample_rate;
gwfparams.dataDir = dataDir;
gwfparams.fileName = 'raw.dat';
gwfparams.dataType = sp.dtype;
gwfparams.nCh = sp.n_channels_dat;
gwfparams.wfWin = [-(0.001*gwfparams.sr) 0.002*gwfparams.sr]; % Number of samples before and after spiketime to include in waveform
gwfparams.nWf = floor(length(sp.st) * FRAC);
gwfparams.spikeTimes = ceil(sp.st * sp.sample_rate);
gwfparams.spikeClusters = sp.clu;
wf = getWaveForms(gwfparams);
Hope this helps.