forked from brendonw1/KilosortWrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakeClassicFet_KSW.m
executable file
·58 lines (47 loc) · 1.3 KB
/
MakeClassicFet_KSW.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
function MakeClassicFet_KSW(basename,dirname)
%get basic input params if not there
if ~exist('basename','var')
[~,basename] = fileparts(cd);
end
if ~exist('dirname','var')
dirname = cd;
end
cd(dirname)
% if already .fets, move them to a new folder called "PreviousFets"
d = dir(fullfile(dirname,[basename '.fet.*']));
if ~isempty(d);
mkdir(fullfile(dirname,'PreviousFets'))
for a = 1:length(d);
movefile(fullfile(dirname,d(a).name),fullfile(dirname,'PreviousFets',d(a).name));
end
end
%if ~exist([basename '.fil'],'file')
% cmd = ['process_mhipass ' basename];
% system(cmd)
%end
if ~exist([basename '.fil'])
xml = LoadXml([basename '.xml']);
inname = [basename '.dat'];
outname = [basename '.fil'];
numch = num2str(xml.nChannels);
sampl = num2str(xml.SampleRate);
lowband = '800';
highband = '9500';
forder = '50';
gain = '1';
offset = '0';
firfilter_KSW(inname,outname,numch,sampl,lowband,highband,forder,gain,offset);
end
%get xml
[xml, rxml] = LoadXml([basename '.xml']);
nGrps = length(xml.SpkGrps);
for g = 1:nGrps
cmd = ['process_pca_multi ' basename ' ' num2str(g)];
% cmd = ['ndm_pca ' basename ' ' num2str(i)];
disp(cmd)
a = system(cmd)
end
if a ==0
cmd = ['rm ' basename '.fil'];
system(cmd)
end