Tom Holroyd (NIH/NIMH) [E] tomh at KURAGE.NIMH.NIH.GOV
Wed Feb 22 23:11:25 CET 2006

Robert Oostenveld wrote:
> Hi Tom,
> The default for freqanalysis is cfg.channelcmb='all', which means all-
> with-all. If you do'MEG' in preprocessing and use the
> default in freqanalysis, you'll hence get MEG-with-MEG.  Alternatively,
> preprocessing with'all' should also work  and you should be
> able to get MEG-with-MEG using cfg.channelcmb as  you have specified it.

However, you can't. :-)

> PS The code is not very readible, and is pretty old. I would  implement
> it differently (although with the same basic idea) if I had  to do it
> again. All the string comparisons between all channel  combinations make
> it very slow.

That's certainly true; with 275 channels there are over 37,000 pairs.

In prepare_freq_matricies.m, on line 125, Nchan is 302.  The problem is that size(freq.label) is 306.  Somewhere it is dropping some channels, and the numbers don't match.

I did this:

I let default in preprocessing, and used

cfg.channelcmb = channelcombination({'MEG' 'MEG'}, data.label);

with freqanalysis.  Then to examine the state in sourceanalysis:

> dbstop('prepare_freq_matrices', '125');

At this point, has the MEG channels and the references ONLY (and the references have been moved to the end for some reason).  freq.label includes everything.  Because they don't match, the matrix is built to the wrong size.  I tried pruning to just the MEGs, but that caused more problems downstream.  FYI, the script I'm using uses prepare_leadfield, does that matter?

Dr. Tom Holroyd
The 9th Amendment of the U.S. Constitution:
"The enumeration in the Constitution, of certain rights, shall not be
construed to deny or disparage others retained by the people."

More information about the fieldtrip mailing list