Skip to content

Commit 9c8306f

Browse files
authored
Merge pull request #258 from Julie-Fabre/bleeding_edge_matlab
Bleeding edge matlab
2 parents eaba732 + b0bbd72 commit 9c8306f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

+bc/+qm/+helpers/getSpatialDecay.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575

7676
% Perform exponential fit using lsqcurvefit
7777
[fitParams, ~, residual, ~, ~, ~, jacobian] = lsqcurvefit(expDecayFun, initialGuess, spatialDecayPoints_loc, spatialDecayPoints', [], [], options);
78-
7978
spatialDecaySlope = fitParams(2); % The decay rate is the second parameter
8079
spatialDecayFit = fitParams;
8180

+bc/+qm/waveformShape.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
% (find peaks and troughs using MATLAB's built-in function)
6363
thisWaveform = templateWaveforms(thisUnit, :, maxChannel);
6464
nChannels_to_eval = 1;
65-
if any(isnan(thisWaveform)) % kilosort can sometimes return all NaNs in a waveform, we classify these units as noise
65+
if any(isnan(thisWaveform)) || all(thisWaveform == 0) % kilosort can sometimes
66+
% return all NaNs or zeros in a waveform (not sure why), we classify these units as noise
6667
nPeaks = NaN;
6768
nTroughs = NaN;
6869
mainPeak_before_size = nan(1,nChannels_to_eval);
@@ -74,7 +75,7 @@
7475
peakLocs = NaN;
7576
troughLocs = NaN;
7677
waveformDuration_peakTrough = NaN;
77-
if param. param.spDecayLinFit
78+
if param.spDecayLinFit
7879
num_buff = 6;
7980
else
8081
num_buff = 10;
@@ -84,11 +85,16 @@
8485
waveformBaseline = NaN;
8586
spatialDecayPoints_loc = nan(1, num_buff);
8687
spatialDecayFit_1 = NaN;
88+
scndPeakToTroughRatio = NaN;
89+
mainPeakToTroughRatio = NaN;
90+
peak1ToPeak2Ratio = NaN;
91+
troughToPeak2Ratio = NaN;
92+
8793
else
8894
% get waveform peaks, troughs locations, sizes and widths for top 17
8995
% channels
9096
theseChannels = maxChannel; % - 8 : maxChannel + 8;
91-
for iChannel = 1%:17 % evaluate peak and trough sizes and widths for top 17 channels
97+
for iChannel = 1%:17 % evaluate peak and trough sizes and widths for top 17 channels (To do - only 1 channel for now)
9298
if theseChannels(iChannel) > 0 && theseChannels(iChannel) <= size(templateWaveforms,3)
9399
if theseChannels(iChannel) == maxChannel
94100
thisWaveform = templateWaveforms(thisUnit, :, theseChannels(iChannel));

0 commit comments

Comments
 (0)