Dear Vladimir, could you elaborate a bit on this.
I seem to have a similar problem with applying my fieldtrip/eeglab ICA rejection to my original data (MEG data neuromag-triux system). To extract the montage I added the following lines
in ft_rejectcomponent (at around line 170):
...
montage.labelnew = labelnew;
data = ft_apply_montage(data, montage, 'keepunused', keepunused);
% added by mortenj
ofile = [comp.cfg.previous.datafile(1:end-4) '_icamontage.mat'];
save(ofile,'montage');
if isfield(data, 'grad') || (isfield(data, 'elec') &&
isfield(data.elec, 'tra')),
if isfield(data, 'grad')
...
And i called ft_rejectcomponent with the following input (where comp contained the in my case 64 calculated ICA component):
**
cfg = [];
cfg.runica.pca = 64;
cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB
comp = ft_componentanalysis(cfg, data);
cfg = [];
cfg.component = [1 2 6 41];
data = ft_rejectcomponent(cfg, comp)
**
But when trying to apply the icamontage in fieldtrip on the spm-converted rawfile, I get the following error: "Error using spm_eeg_montage (line 148)
not all channels that are used in the montage are
available".
One thing I noticed is that the montage before the calling spm_eeg_montage looks like:
% Montage format:
% tra: [308x64 double]
% labelorg: {64x1 cell}
% labelnew: {308x1 cell}
While after the spm_eeg_montage call (breakpoint at line 137) looks like
% tra: [308x380 double]
% labelorg: {380x1 cell}
% labelnew: {308x1 cell}
Where labelorg contains all 64 ICA components as well as the original MEG/EEG channels.
Hope this makes sense.
Kind regards,
Morten
|