-
Notifications
You must be signed in to change notification settings - Fork 22
/
jrc.m
187 lines (180 loc) · 4.82 KB
/
jrc.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
% JRCLUST v4
% Alan Liddell, Vidrio Technologies
% Originally written by James Jun
function hJRC_ = jrc(varargin)
%JRC
if nargout > 0
hJRC_ = [];
end
if nargin < 1
disp(jrclust.utils.help()); % later: GUI
return;
end
% discard try-catch here for now as these messages are next to useless
hJRC = JRC(varargin{:});
if hJRC.inProgress()
hJRC.hCfg.verbose = 1; % invocation from command line is always verbose
hJRC.run();
end
if hJRC.isError
error(hJRC.errMsg);
end
if nargout > 0
hJRC_ = hJRC;
elseif ~isempty(hJRC.res) && hJRC.hCfg.exportResults % export results to workspace
jrclust.utils.exportToWorkspace(struct('res', hJRC.res), 0);
end
return;
end
%%
% case 'import-tsf'
% import_tsf_(vcArg1);
%
% case 'import-h5'
% import_h5_(vcArg1);
%
% case 'import-intan'
% vcFile_prm_ = import_intan_(vcArg1, vcArg2, vcArg3);
% return;
%
% case {'import-nsx', 'import-ns5'}
% vcFile_prm_ = import_nsx_(vcArg1, vcArg2, vcArg3);
% return;
%
% case 'nsx-info'
% [~, ~, S_file] = nsx_info_(vcArg1);
% assignWorkspace_(S_file);
% return;
%
% case 'load-nsx'
% load_nsx_(vcArg1);
% return;
%
% case 'import-gt'
% import_gt_silico_(vcArg1);
%
% case 'unit-test'
% unit_test_(vcArg1);
%
% case 'test'
% varargout{1} = test_(vcArg1, vcArg2, vcArg3, vcArg4, vcArg5);
%
% case {'make-trial', 'maketrial', 'load-trial', 'loadtrial'}
% make_trial_(vcFile_prm, 0);
%
% case {'loadtrial-imec', 'load-trial-imec', 'make-trial-imec', 'maketrial-imec'}
% make_trial_(vcFile_prm, 1);
%
% case 'batch'
% batch_(vcArg1, vcArg2);
%
% case {'batch-verify', 'batch-validate'}
% batch_verify_(vcArg1, vcArg2);
%
% case {'batch-plot', 'batch-activity'}
% batch_plot_(vcArg1, vcArg2);
%
% case 'describe'
% describe_(vcFile_prm);
%
% case {'import-kilosort', 'import-ksort'}
% import_ksort_(vcFile_prm);
%
% case 'import-silico'
% import_silico_(vcFile_prm, 0);
%
% case 'import-silico-sort'
% import_silico_(vcFile_prm, 1);
%
% case 'export-imec-sync'
% export_imec_sync_(vcFile_prm);
%
% case 'export-prm'
% export_prm_(vcFile_prm, vcArg2);
%
% case 'preview-test'
% preview_(P, 1);
% gui_test_(P, 'Fig_preview');
%
% case 'traces-lfp'
% traces_lfp_(P)
%
% case 'traces-test'
% traces_(P);
% traces_test_(P);
%
% case 'manual-test'
% manual_(P, 'debug');
% manual_test_(P);
% return;
%
% case 'manual-test-menu'
% manual_(P, 'debug');
% manual_test_(P, 'Menu');
% return;
%
% case 'export-spk'
% S0 = get(0, 'UserData');
% trSpkWav = jrclust.utils.readBin(jrclust.utils.subsExt(P.vcFile_prm, '_spkwav.jrc'), 'int16', S0.dimm_spk);
% assignWorkspace_(trSpkWav);
%
% case 'export-raw'
% S0 = get(0, 'UserData');
% trWav_raw = jrclust.utils.readBin(jrclust.utils.subsExt(P.vcFile_prm, '_spkraw.jrc'), 'int16', S0.dimm_spk);
% assignWorkspace_(trWav_raw);
%
% case {'export-spkwav', 'spkwav'}
% export_spkwav_(P, vcArg2); % export spike waveforms
%
% case {'export-chan'}
% export_chan_(P, vcArg2); % export channels
%
% case {'export-car'}
% export_car_(P, vcArg2); % export common average reference
%
% case {'export-spkwav-diff', 'spkwav-diff'}
% export_spkwav_(P, vcArg2, 1); % export spike waveforms
%
% case 'export-spkamp'
% export_spkamp_(P, vcArg2); %export microvolt unit
%
% case {'export-csv', 'exportcsv'}
% export_csv_(P);
%
% case {'export-quality', 'exportquality', 'quality'}
% export_quality_(P);
%
% case {'export-csv-msort', 'exportcsv-msort'}
% export_csv_msort_(P);
%
% case {'export-fet', 'export-features', 'export-feature'}
% export_fet_(P);
%
% case 'export-diff'
% export_diff_(P); %spatial differentiation for two column probe
%
% case 'import-lfp'
% import_lfp_(P);
%
% case 'export-lfp'
% export_lfp_(P);
%
% case 'drift'
% plot_drift_(P);
%
% case 'plot-rd'
% plot_rd_(P);
%
% if contains_(lower(vcCmd), {'verify', 'validate'})
% if ~is_detected_(P)
% detect_(P);
% end
% if ~is_sorted_(P)
% sort_(P);
% end
% validate_(P);
% elseif contains_(lower(vcCmd), {'filter'})
% TWfilter_(P);
% elseif fError
% help_();
% end