[FieldTrip] problems with ft_dipolesimulation

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Wed Mar 30 09:26:01 CEST 2011


Dear Don,

Thanks for your message. I was able to reproduce the issue using a  
similar setup (using a 4D gradiometer array constructed from a dataset  
recorded in St.Louis). There indeed was an issue related to the  
reducerank option, which you indeed bypassed by explicitly specifying  
this to be a numeric value. Yet, ft_dipolesimulation should also work  
on eeg data, i.e. computing leadfields without reduced rank should  
also be supported.
Fortunately I see an easy solution: for one or another reason there  
are the following lines in ft_compute_leadfield:

if strcmpi(reducerank,'yes') || strcmpi(reducerank,'no')
   reducerank = istrue(reducerank);
end

which convert the variable reducerank, if it is a string, into a  
boolean. The boolean variable causes the problem you reported. Note  
that the boolean will not be created when you specify manually that  
reducerank is numeric. Commenting out these lines does the trick for  
me, and does not seem to affect the rest of the code. I'll remove them  
from the code, and the latest version will be available tonight (CET).  
I hope for now that you can work your way around it.

best wishes,

Jan-Mathijs

On Mar 29, 2011, at 6:58 PM, Rojas, Don wrote:

> To all:
>
> Regarding that last email, I think I found the problem. Line 187 of  
> ft_dipolesimulation calls ft_compute_leadfield, which in my case  
> returned all zeros, so that explains the zeroed data in the output.  
> If I change that line to read:
>
> lf = ft_compute_leadfield(dippos{trial}, sens, vol,'reducerank',2);
>
> to reflect the fact that the input is gradiometer sensors, the  
> simulation is correct. I'm thinking perhaps that code needs to  
> detect the sensor type for input to ft_compute_leadfield.
>
> Thanks,
>
> Don
>
> Begin forwarded message:
>
>> From: "Rojas, Don" <Don.Rojas at ucdenver.edu>
>> Date: March 29, 2011 10:32:32 AM MDT
>> To: Email discussion list for the FieldTrip project <fieldtrip at donders.ru.nl 
>> >
>> Subject: problems with ft_dipolesimulation
>>
>> Dear Fieldtrippers,
>>
>> I'm having difficulties trying to construct a simulated dataset  
>> using ft_dipolesimulation. I am simulating using a 4D MEG sensor  
>> array, read in from an existing dataset (this dataset poses no  
>> particular problems when used in other FT routines, but I'm only  
>> using the headshape and the gradiometer location/orientation info  
>> for the headmodel and simulation anyway). The problem is that I am  
>> getting values of zero in all channels at all time points in the  
>> simulated set. No errors are generated, but there is a message  
>> about the RMS value of simulated data is 0 when ft_dipolesimulation  
>> is run - no surprise there. Here is my code:
>>
>> % read 4D file
>> file = 'c,rfhp0.1Hz';
>> hdr  = ft_read_header(file);
>> hs   = ft_read_headshape('hs_file');
>>
>> % create a single sphere conductor model from 4D dataset
>> cfg                 = [];
>> cfg.grad            = hdr.grad;
>> cfg.headshape       = hs.pnt;
>> cfg.singlesphere    = 'yes';
>> ft_sphere           = ft_prepare_localspheres(cfg);
>>
>> % simulate a dipole
>> cfg_sim.vol            = ft_sphere;
>> cfg_sim.grad           = hdr.grad;
>> cfg_sim.fsample        = hdr.Fs;
>> cfg_sim.relnoise       = .1;
>> cfg_sim.dip.frequency  = 20;
>> cfg_sim.dip.phase      = pi/2; % 90 degree phase
>> cfg_sim.triallength    = 1;
>> cfg_sim.ntrials        = 50;
>> cfg_sim.dip.pos        = [0 -.05 .05]; % position in meters
>> cfg_sim.dip.mom        = [0 0 -1]';
>> sim                     = ft_dipolesimulation(cfg_sim);
>>
>> Also, I have run the script from the following example:
>>
>> http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit
>>
>> The simulated data in that example also has no data other than  
>> zeros in all channels. So, I don't think this is due to my code per  
>> se, which was adapted from that example. My MATLAB version is 2009b  
>> (maci64) and I've tried this in several FT versions, including the  
>> 20110328 version, all of which produce the same results.
>>
>> Any ideas?
>>
>> Don
>>
>> -----------------------
>> Don Rojas, Ph.D.
>> Associate Professor of Psychiatry
>> U. of Colorado Denver Anschutz Medical Campus
>> Director, UCD Magnetoencephalography Lab
>> 13001 E. 17th Pl F546
>> Aurora, CO 80045
>> USA
>> 303-724-4994
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Dr. J.M. (Jan-Mathijs) Schoffelen
Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands
J.Schoffelen at donders.ru.nl
Telephone: 0031-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20110330/4d0b76c1/attachment-0002.html>


More information about the fieldtrip mailing list