prepare_ImaGIN_ArtefactCorrectionModel.m
1.42 KB
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
function prepare_ImaGIN_ArtefactCorrectionModel(tms, time_break, rc1, rc2, nb, mode, channels, adjustement, screenshot, estimate, FileIn, FileOut, DirScreenshots)
% FileIn: path linking to the MEEG file to correct
% DirOut: output path
% tms: total stimulation time (s)
% rc1: minimum value of RC (s) (default:1e-5)
% rc2: maximum value of RC (s) (default:1e-3)
% nb: number of artifact shape generated (default:500)
% mode: stimulation mode (monophasic or biphasic)
S.Fname=FileIn;
if ischar(tms)
tms=str2num(tms);
end
S.tms=tms;
if ischar(time_break)
time_break=str2num(time_break);
end
S.break=time_break;
if ischar(rc1)
rc1=str2num(rc1);
end
S.rc1=rc1;
if ischar(rc2)
rc2=str2num(rc2);
end
S.rc2=rc2;
if ischar(nb)
nb=str2num(nb);
end
S.nb=nb;
if ischar(channels)
channels = str2num(channels);
if channels == 0
channels = [];
end
end
S.channels = channels;
if strcmp(screenshot,'False')
screenshot=false;
else if strcmp(screenshot,'True')
screenshot=true;
end
end
S.screenshot = screenshot;
if strcmp(estimate,'False')
estimate=false;
else if strcmp(estimate,'True')
estimate=true;
end
end
if ischar(adjustement)
adjustement=str2num(adjustement);
end
S.adjustement=adjustement;
S.artefactEstimation = estimate;
S.DirScreenshots = DirScreenshots;
S.mode=mode;
S.FileOut=FileOut;
D=ImaGIN_ArtefactCorrectionModel(S);
set_final_status('OK')
close all
end