[FieldTrip] problems with ft_dipolesimulation

Rojas, Don Don.Rojas at ucdenver.edu
Tue Mar 29 18:58:11 CEST 2011

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.



Begin forwarded message:

From: "Rojas, Don" <Don.Rojas at ucdenver.edu<mailto: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<mailto: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:


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 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

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

More information about the fieldtrip mailing list