Dear Morten,
There is a way to call ft_rejectcomponents with the original data and ICA weights as input and that's what you should do. The montage you provide to SPM should transform from the original channels to the same channels. The montage you provided is from components to channels and SPM does not know what those components are. If you can't figure out how to get the right montage, ask on the FT list.
Best,
Vladimir
On 12 Mar 2012, at 10:22, Morten Jønsson <[log in to unmask]> wrote:
> 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
>
|