<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Fieldtrippers,<div><br></div><div>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:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(49, 152, 51); ">% read 4D file</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(175, 77, 240); "><span style="color: #000000">file = </span>'c,rfhp0.1Hz'<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">hdr  = ft_read_header(file);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">hs   = ft_read_headshape(<span style="color: #af4df0">'hs_file'</span>);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(49, 152, 51); ">% create a single sphere conductor model from 4D dataset</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg                 = [];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.grad            = hdr.grad;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.headshape       = hs.pnt;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg.singlesphere    = <span style="color: #af4df0">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">ft_sphere           = ft_prepare_localspheres(cfg);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(49, 152, 51); ">% simulate a dipole</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.vol            = ft_sphere;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.grad           = hdr.grad;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.fsample        = hdr.Fs;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.relnoise       = .1;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.dip.frequency  = 20;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.dip.phase      = pi/2; <span style="color: #319833">% 90 degree phase</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.triallength    = 1;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.ntrials        = 50;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.dip.pos        = [0 -.05 .05]; <span style="color: #319833">% position in meters</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">cfg_sim.dip.mom        = [0 0 -1]';</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">sim                     = ft_dipolesimulation(cfg_sim);</div><div><br></div><div>Also, I have run the script from the following example:</div><div><br></div><div><a href="http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit">http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit</a></div><div><br></div><div>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.</div><div><br></div><div>Any ideas?</div><div><br></div><div>Don</div><div><br></div><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-----------------------<br>Don Rojas, Ph.D.<br>Associate Professor of Psychiatry<br>U. of Colorado Denver Anschutz Medical Campus<br>Director, UCD Magnetoencephalography Lab<br>13001 E. 17th Pl F546<br>Aurora, CO 80045</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">USA<br>303-724-4994</div>
</div>
<br></div></body></html>