From 3ff2058724ecb39ef400c5e31dd8d2e4c4e32588 Mon Sep 17 00:00:00 2001 From: petersenpeter Date: Wed, 31 Jul 2019 16:39:22 -0400 Subject: [PATCH] Update loadSpikes.m --- calc_CellMetrics/loadSpikes.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/calc_CellMetrics/loadSpikes.m b/calc_CellMetrics/loadSpikes.m index 2e6d152f..2e1ee18c 100644 --- a/calc_CellMetrics/loadSpikes.m +++ b/calc_CellMetrics/loadSpikes.m @@ -31,7 +31,7 @@ % By Peter Petersen % petersen.peter@gmail.com -% Last edited: 20-06-2019 +% Last edited: 31-07-2019 % Version history % 3.2 waveforms for phy data extracted from the raw dat @@ -89,6 +89,7 @@ end else forceReload = true; + spikes = []; end % Loading spikes @@ -106,7 +107,6 @@ case {'klustakwik', 'neurosuite'} disp('loadSpikes: Loading Klustakwik data') unit_nb = 0; - spikes = []; shanks_new = []; if isnan(shanks) fileList = dir(fullfile(clusteringPath,[baseName,'.res.*'])); @@ -122,7 +122,7 @@ if ~raw_clusters cluster_index = load(fullfile(clusteringPath, [baseName '.clu.' num2str(shank)])); time_stamps = load(fullfile(clusteringPath,[baseName '.res.' num2str(shank)])); - if getWaveforms + if getWaveforms & useNeurosuiteWaveforms fname = fullfile(clusteringPath,[baseName '.spk.' num2str(shank)]); f = fopen(fname,'r'); waveforms = LSB * double(fread(f,'int16')); @@ -242,7 +242,7 @@ if getWaveforms % gets waveforms from dat file spikes = GetWaveformsFromDat(spikes,xml,basepath,baseName,LSB,session); end - + % Loading klustaViewa - Kwik format (Klustasuite 0.3.0.beta4) case 'klustaViewa' disp('loadSpikes: Loading KlustaViewa data')