[Eeglablist] Trying to get ERSP for for component clusters
Dominic Roe
droe3 at sheffield.ac.uk
Mon Jul 21 04:06:12 PDT 2025
Dear EEGLAB community,
I am seeking help with a problem I keep getting when trying to plot ERSP
for my component clusters.
My study design is a 2x2, two groups (training vs control) and two time
points (pre vs post).
I am looking to see if there is a difference in the ERD in mu and beta
frequency bands in the sensorimotor area. Both between groups and also
between time points.
I have created my study using the command line and I am able to get to the
point of plotting ERSP, ERP, spectra, ITC's and ERPimage but when I try to
do this I get this error message:
Warning, this function is obsolete and only partially backward compatible;
use std_readdata instead
This function can now only read one cluster at a time
Reading subjects' data or looking up measure values in EEGLAB cache
...Unrecognized field name "comp62".
Error in std_readfile>getfiledata (line 391) if
ischar(fileData.(fieldToRead)) % special ERP-image
Error in std_readfile (line 284) [ measureData, trialInfo, events ] =
getfiledata(fileData, NaN, v6Flag, options{:}); % read all data
Error in std_readfile (line 100) [measureDataTmp{iFile}, parameters,
measureRange1, measureRange2, eventsTmp{iFile}, trialInfoTmp{iFile}] =
std_readfile(fileBaseName{iFile}, varargin{:});
Error in std_readdata (line 248) else [dataTmp{iSubj}, params, xvals,
yvals, eventsTmp{iSubj}, dataTmpSubj{iSubj} ] = std_readfile( fileName,
'designvar', struct(bigstruct.design.variable), opts{:}, 'components',
compList);
Error in std_readerp (line 80) [STUDY, datavals, xvals, yvals, events,
params] = std_readdata(STUDY, ALLEEG, varargin{:});
But I am unsure why this is happening.
This is the code I am using to create my study, precompute component
measures, precluster, cluster and then try and plot:
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
pop_editoptions( 'option_storedisk', 1);
control_subject = { '05' '06' '08' '11' '18' '19' '24' '32' '34' '37' '40' '43'
'45' '47' '49'};
training_subject = { '03' '04' '09' '10' '12' '17' '20' '23' '25' '33'
'35' '36'
'38' '41' '44' '48'};
base_path = 'X:\myles_jones\Shared\Dominic\Study 1\REAL DATA\';
commands = {};
index = 1;
for i = 1:length(control_subject)
subj = control_subject{i};
pre_file = fullfile(base_path, 'CONTROL GROUP', 'PRE TEST', 'Preprocessed
Data', ['Pre_' subj '.set']);
post_file = fullfile(base_path, 'CONTROL GROUP', 'POST TEST', 'Preprocessed
Data', ['Post_' subj '.set']);
commands = {commands{:}, ...
{'index', index, 'load', pre_file, 'subject', subj, 'group', 'Control',
'condition', 'Pre', 'session', 1}, ...
{'index', index+1, 'load', post_file, 'subject', subj, 'group', 'Control',
'condition', 'Post', 'session', 2}};
index = index + 2;
end
for p = 1:length(training_subject)
subj2 = training_subject{p};
pre_file2 = fullfile(base_path, 'TRAINING GROUP', 'PRE TEST', 'Preprocessed
Data', ['Pre_' subj2 '.set']);
post_file2 = fullfile(base_path, 'TRAINING GROUP', 'POST TEST', 'Preprocessed
Data', ['Post_' subj2 '.set']);
commands = {commands{:}, ...
{'index', index, 'load', pre_file2, 'subject', subj2, 'group', 'Training',
'condition', 'Pre', 'session', 1}, ...
{'index', index + 1, 'load', post_file2, 'subject', subj2, 'group',
'Training', 'condition', 'Post', 'session', 2}};
index = index + 2;
end
commands = {commands{:} {'dipselect', 0.15} };
[STUDY ALLEEG] = std_editset(STUDY, ALLEEG, 'name', 'Training study 3',
'commands', commands);
EEG = ALLEEG;
CURRENTSTUDY = 1;
CURRENTSET = 1:length(EEG);
[STUDY, ALLEEG] = std_checkset(STUDY, ALLEEG);
eeglab redraw
EEG=pop_chanedit(EEG, 'lookup',
'X:\\myles_jones\\Shared\\Dominic\\eeglab-2025.0.0\\plugins\\dipfit5.5\\standard_BEM\\elec\\standard_1005.elc'
);
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
EEG = pop_dipfit_settings( EEG,'hdmfile',
'X:\\myles_jones\\Shared\\Dominic\\eeglab-2025.0.0\\plugins\\dipfit5.5\\standard_BEM\\standard_vol.mat'
,'mrifile',
'X:\\myles_jones\\Shared\\Dominic\\eeglab-2025.0.0\\plugins\\dipfit5.5\\standard_BEM\\standard_mri.mat'
,'chanfile',
'X:\\myles_jones\\Shared\\Dominic\\eeglab-2025.0.0\\plugins\\dipfit5.5\\standard_BEM\\elec\\standard_1005.elc'
,'coordformat','MNI','coord_transform',[4.3056e-06 -1.2613e-06 3.4264e-06
-1.2794e-07 -3.2383e-08 -1.5708 1 1 1] );
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
EEG = pop_multifit( EEG,5,'threshold',100,'plotopt',{'normlen','on'});
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
[STUDY ALLEEG] = std_editset( STUDY, ALLEEG, 'commands',{{'inbrain','on',
'dipselect',0.15}},'updatedat','on','rmclust','on' );
[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG);
CURRENTSTUDY = 1; EEG = ALLEEG; CURRENTSET = [1:length(EEG)];
[STUDY ALLEEG] = std_editset( STUDY, ALLEEG, 'updatedat','on','rmclust','on'
);
[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG);
CURRENTSTUDY = 1; EEG = ALLEEG; CURRENTSET = [1:length(EEG)];
[STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, 'components',...
'erp','on', 'recompute', 'on', 'erpparams', {'rmbase' [-1000 0] }, 'scalp',
'on','spec','on','specparams', ...
{'freqrange' [3 50] 'specmode' 'fft' 'logtrials' 'off'}, 'erpim', 'on', ...
'erpimparams', {'nlines',10,'smoothing',10}, 'ersp','on','erspparams',{'cycles'
[3 0.5] 'nfreqs' 100 'ntimesout' 200},...
'itc','on');
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
[STUDY ALLEEG] = std_preclust(STUDY, ALLEEG, 1,{'dipoles','weight',1},{
'moments','weight',1});
[STUDY] = pop_clust(STUDY, ALLEEG, 'algorithm','kmeans','clus_num', 18 );
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
[STUDY] = pop_clustedit(STUDY, ALLEEG);
Any help would be greatly appreciated!
Kind regards,
Dominic
PhD Student FHEA
Psychology Department
University of Sheffield
ICOSS Building
More information about the eeglablist
mailing list