forked from bfbarry/EEGLAB-specparam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pop_std_fooofplot.m
43 lines (42 loc) · 2.59 KB
/
pop_std_fooofplot.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
function LASTCOM = pop_std_fooofplot(STUDY, ALLEEG, varargin)
uilist = { { 'style' 'text' 'string' 'Cluster to plot:' } ... %could be drop down list
{ 'style' 'edit' 'string' '' } ...
{ 'style' 'text' 'string' 'Frequency range to fit:' } ...
{ 'style' 'edit' 'string' '' } ...
{ 'style' 'text' 'string' 'Plot in loglog (boolean):' } ... %could be checkmark
{ 'style' 'edit' 'string' 'false' } ...
... % Now FOOOF settings
{ 'style' 'text' 'string' ' FOOOF settings (optional)' 'fontweight' 'bold' }...
{ 'style' 'text' 'string' 'peak_width_limits' } ...
{ 'style' 'edit' 'string' '' } ...
{ 'style' 'text' 'string' 'max_n_peaks' } ...
{ 'style' 'edit' 'string' '' } ...
{ 'style' 'text' 'string' 'min_peak_height' } ...
{ 'style' 'edit' 'string' '' } ...
{ 'style' 'text' 'string' 'peak_threshold' } ...
{ 'style' 'edit' 'string' '' } ...
{ 'style' 'text' 'string' 'aperiodic_mode' } ...
{ 'style' 'edit' 'string' "'fixed'" } ...
{ 'style' 'text' 'string' 'verbose (boolean)' } ...%want to make a checkmark later
{ 'style' 'edit' 'string' 'false' } };
uigeom = { [9 4] [9 3] [9 3] [1] [9 3] [9 3] [9 3] [9 3] [9 3] [9 3]};
[result, usrdat, sres2, sres] = inputgui( 'uilist', uilist, 'geometry', uigeom, 'title', 'FOOOF EEG - pop_std_fooofplot()', 'helpcom', 'pophelp(''pop_std_fooofplot'');', 'userdata', 0); %currently ignoring usrdat, sres2, sres
params = {}; %parameters for std_fooofplot w/o FOOOF settings
settings_keys = {'peak_width_limits','max_n_peaks','min_peak_height','peak_threshold','aperiodic_mode','verbose'};
settings = struct(); %can be empty
for i = 1:length(result)
if i < 4
param_curr = eval( [ '[' result{i} ']' ] );
params{end+1} = param_curr;
else
if ~isempty(eval( [ '[' result{i} ']' ] ))
settings.(settings_keys{i-3}) = eval( [ '[' result{i} ']' ] );
end
end
end
if ~isempty(params)
std_fooofplot(STUDY, ALLEEG, params{1}, params{2}, params{3}, settings);
LASTCOM = sprintf('STUDY = std_fooofplot(STUDY, ALLEEG, [ %s ], [%d %d], %s, %s)', sprintf('%d ', params{1}), params{2}(1), params{2}(2), params{3}, struct2str(settings));
else % clusters % f_range1 f_range2 %loglog settings
LASTCOM = '';
end