[Eeglablist] Problem with co-register sensor locations
Wade Zheng
yzhe163 at aucklanduni.ac.nz
Sun Oct 11 00:50:48 PDT 2020
Hi EEGlab community,
I came across a problem when doing co-register sensor locations. My
original codes are as follows:
% Co-register sensor locations
[~,transform] = coregister(EEG.chanlocs,
'H:\echome\Software\eeglab2020_0\plugins\dipfit3.4\standard_BEM\elec\standard_1020.elc',
'warp', 'auto', 'manual', 'off');
templateChannelFilePath =
'H:\echome\Software\eeglab2020_0\plugins\dipfit3.4\standard_BEM\elec\standard_1005.elc';
hdmFilePath =
'H:\echome\Software\eeglab2020_0\plugins\dipfit3.4\standard_BEM\standard_vol.mat';
EEG = pop_dipfit_settings( EEG, 'hdmfile', hdmFilePath, 'coordformat',
'MNI',...
'mrifile',
'H:\echome\Software\eeglab2020_0\plugins\dipfit3.4\standard_BEM\standard_mri.mat',...
'chanfile', templateChannelFilePath, 'coord_transform',transform,...
'chansel', 1:EEG.nbchan);
EEG = pop_multifit(EEG, 1:EEG.nbchan,'threshold', 100,
'dipplot','off','plotopt',{'normlen' 'on'});
icIdx = 23;
d1 = EEG.dipfit.model(icIdx).datapot;
d2 = EEG.dipfit.model(icIdx).idealProj;
rv = sum((d1-d2).^2) ./ sum(d1.^2);
EEG.dipfit.model(icIdx).rv; % Should be identical as rv obtained above.
figure
subplot(1,2,1)
topoplot(d1, EEG.chanlocs)
subplot(1,2,2)
topoplot(d2, EEG.chanlocs)
But it gave me an error :
Reference to non-existent field 'idealProj'.
Error in PreProWithAMICA (line 88)
d2 = EEG.dipfit.model(icIdx).idealProj;
Then I looked up Makoto's useful EEGLAB codes and added "EEG.dipfit.model(
cfg.component).idealProj = source.dip.pot;" just before "icldx" and ran it
again. But this time I still got an error: Unable to resolve the name
cfg.component.
Error in PreProWithAMICA (line 85)
EEG.dipfit.model(cfg.component).idealProj = source.dip.pot; Can anyone
please tell me where my mistake is? Many thanks! Regards, Wade
More information about the eeglablist
mailing list