[Eeglablist] Question about STUDY datastructure
Michael Stevens
msteven at harthosp.org
Fri Nov 7 19:47:04 PST 2008
Hey folks,
To save myself time in creating STUDY structures, I wrote up a bit of code that helps to create a STUDY structural array by automatically assigning filenames, condition names, subject names, group names, etc after using a GUI to select groups of files. I thought I had it working, but one thing keeps messing up the STUDYs I create with it. After the study is created and data is loaded, I get an error in the 'Precompute channel measures' function. What happens is that I get an error display box that says:
EEGLAB error in function std_chanlookup() at line 89:
Subscript indices must be either real positive integers or logicals.
If you think this is a bug, please send a detailed
description of how to reproduce the problem, with
a (small) test dataset, to eeglab at sccn.ucsd.edu.
The message flashes up regardless of which type of data I want to precompute, as if it's being called as a logical check on data structure. So I tracked down std_chanlookup as a sub-function in std_changroup.m. However, this looks like it's just doing it's job. It bombs when it encounters a NaN in the STUDY.setind variable and tries to use this value to do a check back in ALLEEG.chanlocs.labels.
Here's the odd part... The error ONLY comes up if I have more than one condition in the STUDY structure. In fact, if I construct something with several conditions using my snippet of MATLAB code, but then use the 'Edit study info' option so there's only one condition, it works fine! (presumably because the STUDY.setind becomes a row of integers without any NaN's). So, I played around with this for an hour or two tonight trying to see if different combinations of conditions vs. groups would work vs. not work. By editing the study info, I can change the STUDY.setind accurately (just by calling std_checkset.m). However, no matter what I do, that error flashes up when there's more than one condition.
So, here's the REALLY odd part... If I build a study using the input GUI, it'll work fine... Regardless of the number of groups, conditions, etc. At least, it works the first time I use the STUDY. But once I start changing things about the number of conditions (either changes directly to the MATLAB variables themselves or even by using the GUI to change things), I can no longer get the 'Precompute channel measures' function to work (i.e., it gives me that 'std_chanlookup() at line 89' error).
Am I missing something simple in the code that I can add to make things work? I thought I had identified the relevant *.m files and variables involved with this, but perhaps I'm missing another component of the process? I think I figured out enough to get EEGLAB to precompute everything and then 'fake it' to reassign conditions and groups to use the nice STUDY group plotting functions. But this isn't elegant and nearly defeats the purpose of the STUDY building code I whipped up. I'd rather have a fix.
Alternatively, if someone out there already built some code for this to circumvent the GUI for hundreds of datasets to be loaded and wants to share... I'm not proud! I'll dump the code I've been working up. Otherwise, any help would be appreciated in tracking down what I'm doing wrong.
Thanks,
Mike
Michael C. Stevens, Ph.D.
Director, Child and Adolescent Research
The Institute of Living / Hartford Hospital
Director, Clinical Neuroscience & Development Laboratory
Olin Neuropsychiatry Research Center
Assistant Clinical Professor of Psychiatry
Yale University School of Medicine
Contact Information:
200 Retreat Avenue
ONRC, Whitehall Building
Hartford, CT 06106
Tel: (860) 545-7552
Fax: (860) 545-7797
More information about the eeglablist
mailing list