[Eeglablist] Removing Components makes "index exceeds matrix dimension" error in SIFT

Tim Mullen mullen.tim at gmail.com
Wed Aug 7 12:01:09 PDT 2013


Hi Balazs,

First, just to be clear, you pruned the set of components using pop_subcomp
(which will ensure a consistent dataset with proper dimensions for .icawinv
and equal number of dipoles to components)?

If so, I suspect you ran SIFT once before for this dataset before pruning.
In this case the pre-processing function would have retrieved the default
value for ComponentsToKeep from the currently stored value in
EEG.CAT.curComponentNames -- i.e. the last set of components you selected
in SIFT before you pruned the dataset. This would explain why the default
list of components is set to 1:16. BrainMovie3D uses the list in
EEG.CAT.curComponentNames to plot labels at each node location. If the
length of this list exceeds the actual number of nodes (components) an
error will occur.

However, the fix is simple.

The cleanest, failsafe, solution is just to remove the 'CAT' field from the
EEG structure...
EEG = rmfield(EEG,'CAT');
ALLEEG(CURRENTSET) = EEG;
...and then run the SIFT pipeline again. This will clear all SIFT usage
history (note this will also clear any previous SIFT result you had).

If you want to preserve your previously calculated results, then you
*should* only need to fix the .curComponentNames, and .curComps lists by
typing:
EEG.CAT.curComponentNames = strtrim(cellstr(num2str((1:9)'))');
EEG.CAT.curComps = 1:9;
ALLEEG(CURRENTSET) = EEG:

The BrainMovie should now work properly.

A tip: in many cases there is automatic "sanity checking" of default
options, but in some cases these checks may not be present. So always make
sure that default options -- such as the range of components -- match your
expectations before proceeding to the next step in processing. In releases
of SIFT prior to 1.0b, it's also important not to run pre-processing twice
on the same dataset.

Cheers,
Tim


On Tue, Aug 6, 2013 at 9:20 AM, boglyas <kamanbalazs at gmail.com> wrote:

> Hy there,
>
> I tried to remove components from EEG data set for better results, but I
> cannot use the 3D brain movie in SIFT after that,because it gives an error
> "Index exceeds matrix dimensions".
>
> Basically it was a 61 channel recording with 60 (or 61) components, but I
> had a data set that was already pruned, it had only 16 components/dipoles.
> Some of the dipoles from the 16 were not in the cortex, they were deep
> inside the brain (eg. thalamus), so I decided to remove those in order to
> have better results later. After removing these components, if i check the
> plotting in the EEGlab, or the  EEG <1x1 struct> in MATLAB, it all says
> that it has 9 components left.
>
> At the same time, if I try to run SIFT, every tool thinks that i have 16
> components (and not 9). Even in pre-processing, the default "components to
> keep" goes like: 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16;
>
> Meanwhile it doesn't give error during the pre-pocessing or the model
> fitting, and the validation also seems ok. I can visualize the connectivity
> result in a Time-Frequency grid (and it only plots 9 x 9 figure), but when
> I try to visualize in BrainMovie3D, it crashes, error messages, and so on.
>
> What should I do, or what did I do wrong?
>
> Thanks,
> Balazs
>
>
> 2013/8/6 boglyas <kamanbalazs at gmail.com>
>
>> Hy there,
>>
>> I tried to remove components from EEG data set for better results, but I
>> cannot use the 3D brain movie in SIFT after that,because it gives an error
>> "Index exceeds matrix dimensions".
>>
>> Basically it was a 61 channel recording with 60 (or 61) components, but I
>> had a data set that was already pruned, it had only 16 components/dipoles.
>> Some of the dipoles from the 16 were not in the cortex, they were deep
>> inside the brain (eg. thalamus), so I decided to remove those in order to
>> have better results later. After removing these components, if i check the
>> plotting in the EEGlab, or the  EEG <1x1 struct> in MATLAB, it all says
>> that it has 9 components left.
>>
>> At the same time, if I try to run SIFT, every tool thinks that i have 16
>> components (and not 9). Even in pre-processing, the default "components to
>> keep" goes like: 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16;
>>
>> Meanwhile it doesn't give error during the pre-pocessing or the model
>> fitting, and the validation also seems ok. I can visualize the connectivity
>> result in a Time-Frequency grid (and it only plots 9 x 9 figure), but when
>> I try to visualize in BrainMovie3D, it crashes, error messages, and so on.
>>
>> What should I do, or what did I do wrong?
>>
>> Thanks,
>> Balazs
>>
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>



-- 
---------  αντίληψη -----------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20130807/3f682dd2/attachment.html>


More information about the eeglablist mailing list