-
Notifications
You must be signed in to change notification settings - Fork 0
/
nfb_save.m
executable file
·46 lines (39 loc) · 1.07 KB
/
nfb_save.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
% nfb_save saves important results after the experiment is done
%
% USAGE:
%
% nfb_save(in1,in2,in3,in4,in5);
%
% in1 ... config structure
% in2 ... results structure
% in3 ... handle to timeseries figure
% in4 ... full path to config file
% in5 ... full path to output_dir (optional - multile roi)
% this file written by Henry Luetcke (hluetck@gwdg.de)
% passing reference
function nfb_save(rtconfig,reference,ts_fig,outdir)
if nargin < 4
disp('You MUST provide at least 4 input argument');
help nfb_save
return
end
current_dir = pwd;
if nargin == 5
if ~exist(outdir, 'dir')
mkdir(outdir);
end
else
outdir = rtconfig.data.output_dir;
end
cd(outdir);
rtconfig.Close(fullfile(outdir,'rtconfig.txt'));
fid = fopen('reference.txt','w');
fprintf(fid,'%1.0f\n', reference');
fclose(fid);
if ~strcmp(rtconfig.misc.plot_type,'no')
clfcn = get(ts_fig,'CloseRequestFcn');
set(ts_fig,'CloseRequestFcn','closereq');
saveas(ts_fig,'timeseries.fig');
set(ts_fig,'CloseRequestFcn', clfcn);
end
cd(current_dir);