Skip to content

Commit 76edc8f

Browse files
committed
Revert "v3.2.3"
This reverts commit a64ee3a.
2 parents a64ee3a + 1937ef5 commit 76edc8f

File tree

5 files changed

+153
-251
lines changed

5 files changed

+153
-251
lines changed

change_log.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22
J. James Jun
33

44
--------------------------------------------------------------------
5-
[2019/1/3: v3.2.3]
6-
Bugfix: incorrect "gather" function was called for R2017b when Bigdata toolbox is installed.
7-
Faster and more robust fft_clean operation (run if `fft_thresh` > 0)
8-
It can handle a limited GPU memory.
9-
`nLoads_gpu` parameter is introduced, which is the ratio of the system memory (RAM) to GPU memory.
10-
If your GPU memory size is 12 GB and RAM is 96 GB, set nLoads_gpu = 8.
11-
Increase this value if GPU error occurs (default: 8), do not change the default value otherwise.
12-
`nSamples_gpu` is now deprecated, and automatically calculated from `nLoads_gpu` parameter.
13-
14-
[2017/12/30: v3.2.2]
15-
Bugfix: PSTH histogram plot error is fixed and two PSTH plots are displayed
16-
top and bottom when two units are selected.
17-
185
[2017/12/29: v3.2.1]
196
Old multishank probe file format is supported (v1, jrclust.m).
207
'cviShank' which is a cell containing a list of sites is converted to 'shank' format

default.prm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ fInverse_file = 0; % Set to 1 to flip the polarity of the signal
1616
header_offset = 0; % File header offset (set to 0 for files containing no header info (e.g. WHISPER format)
1717

1818
% #Execution parameters
19-
version = 'v3.2.3'; % JRCLUST version. Updated on Jan 3, 2018
19+
version = 'v3.2.1'; % JRCLUST version. Updated on Dec 29, 2017
2020
fVerbose = 0; % Verbose flag, set to 0 to suppress displaying extra information
2121
fParfor = 1; % Use Multiple CPU cores (if parallel processing toolbox is installed)
2222
fGpu = 1; % Use GPU if parallel processing toolbox is installed
2323
iGpu = 1; % Use specific GPU ID (run 'gpuDevice()' to retrieve the list of GPUs)
2424
MAX_BYTES_LOAD = []; % Default memory loading block size (bytes)
2525
MAX_LOAD_SEC = []; % Maximum loading duration (seconds). This overrides "MAX_BYTES_LOAD".
26-
MAX_LOG = 5; % Maximum number of histories to track for 'manual' GUI
27-
nLoads_gpu = 8; % Ratio of RAM to GPU memory. If your GPU memory is 12 GB and RAM is 96 GB, set nLoads_gpu = 8. Increase this number if you get GPU memory error.
26+
MAX_LOG = 5; % Maximum number of histories to track for 'manual' GUI
27+
nSamples_gpu = 250000; % Number of samples to process in GPU at a time. Reduce this number if GPU crashes for high-channel arrays
2828
vcFile_thresh = ''; % Name of .mat file taht stores the spike detection threshold in 'vnThresh_site' variable. Created by 'preview' GUI
2929
sec_per_load_preview = 1; % Recording duration (sec) per continuous segment to preview
3030
nLoads_max_preview = 30; % Number of time segments to load for preview

fft_clean.m

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
function mr1 = fft_clean(mr, thresh, nbins)
2-
% mr must be single
3-
42
if nargin<2, thresh = 6; end
53
if nargin<3, nbins = 20; end
64
nSkip_med = 4;
@@ -10,16 +8,22 @@
108
if thresh==0, thresh = []; end
119
if isempty(thresh), mr1=mr; return ;end
1210

13-
% mr = single(mr);
11+
mr = single(mr);
1412
vrMu = mean(mr, 1);
1513
mr1 = bsxfun(@minus, mr, vrMu);
1614
n = size(mr1,1);
15+
% pad if needed
1716
n_pow2 = 2^nextpow2(n);
18-
if n < n_pow2
19-
mr1 = fft(mr1, n_pow2);
20-
else
21-
mr1 = fft(mr1);
22-
end
17+
% try
18+
if n < n_pow2
19+
mr1 = fft(mr1, n_pow2);
20+
else
21+
mr1 = fft(mr1);
22+
end
23+
% catch
24+
% disp('fft_clean: GPU-based FFT failed. Trying CPU-based FFT. Reset GPU or restart Matlab.');
25+
% mr1 = fft(gather(mr1), n_pow2); %GPU-based FFT failed
26+
% end
2327
n1 = floor(n_pow2/2);
2428
viFreq = (1:n1)';
2529
% vrFft1 = abs(mean(bsxfun(@times, mr1(1+viFreq,:), viFreq), 2));
@@ -60,9 +64,12 @@
6064

6165
mr1(1+vi_noise,:) = 0;
6266
mr1(end-vi_noise+1,:) = 0;
63-
mr1 = real(ifft(mr1, n_pow2, 'symmetric')); %~30% faster than below
64-
% mr1 = real(ifft(mr1));
65-
if n < n_pow2, mr1 = mr1(1:n,:); end
67+
mr1 = real(ifft(mr1)); %slow
68+
if n < n_pow2
69+
mr1 = mr1(1:n,:);
70+
end
71+
72+
6673
mr1 = bsxfun(@plus, mr1, vrMu); %add mean back
6774

6875
if nargout==0 || fDebug

img/manual_gui_menu.png

-309 KB
Binary file not shown.

0 commit comments

Comments
 (0)