Hi Vladimir,
I think there may be a bug in spm_eeg_inv_extract.m
I am using a version you posted to the list serve which fixes the problem with roi=0 value not being recognized.
This version has ID 4554 2011-11-10 10:13:40z
However, I've checked the latest version and the code I changed is the same in both versions.
Specifically, I was interested in extracting moments from single mni coordinates (roi=0mm) and I wanted to create a single file to store these moments.
When done separately, so that individual files were generated, everything worked fine.
But when, I tried to send in a list of XYZ coordinates, I ran into a problem. The first channel looked fine. The second channel however was just a flip sign of the first channel rather than the expected second channel.
Here is why I think this occurred:
The variable iS holds a list of start and end points for each cluster. In my case, my cluster has just one point.
There is a problem in the code that computes the regional response.
in line 179:
y=MY(iS(iS:iS(i+1),:);
I think should be changed to
y=MY(iS(iS+1:iS(i+1),:);
otherwise, the cluster size is 2 rather than one, after the first channel.
To make this work for the first channel, line 173 needs also be changed from
iS = [1 cumsum(cellfun....
to
iS=[0 cumsum(celfun....
Do you agree?
-Teresa
--
Teresa Cheung, PhD
Research Associate
Centre for Speech, Language, and the Brain
University of Cambridge, Downing Street, Cambridge CB2 3EB, UK
|