Hi Akiko,<br><br>I had that same problem and also tried using the 'bemcp' which gave me a vol.mat file that was all NaNs. I did not figure out how to solve the problem in FT directly, but have been having some success creating the head model in SPM and loading that into FeildTrip. The SPM manual helped me.<br>
<br>Hope that is somewhat helpful,<br>Pat<br><br>Patrick Cox<br>Prethesis Student<br>Lab For Computational Cognitive Science <br>Georgetown University Medical Center<br>3970 Reservoir Rd. NW<br>Washington, DC 20007<br><br>
<div class="gmail_quote">On Thu, Feb 9, 2012 at 5:04 PM, Akiko Ikkai <span dir="ltr"><<a href="mailto:akiko.ikkai@gmail.com">akiko.ikkai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>I'm trying to create a volume conduction model for my EEG study based on anatomical MRI, and having trouble with ft_prepare_bemmodel</div><div><br></div><div>when I run </div><div><div><font color="#330099">cfg                = [];</font></div>

<div><font color="#330099">cfg.tissue         = [7 4 1]; % value for brain, skull, and scalp</font></div><div><font color="#330099">cfg.conductivity   = [1 1/80 1]*.33; % after standard_BEM.zip data</font></div><div><font color="#330099">cfg.isolatedsource = true;</font></div>

<div><font color="#330099">cfg.method         = 'dipoli'; </font></div><div><font color="#330099">cfg.sourceunits = 'mm';</font></div><div><font color="#330099">cfg.mriunits = 'mm';</font></div><div>

<font color="#330099">vol = ft_prepare_bemmodel(cfg, seg4bem);</font></div></div><div><br></div><div>I get the following error message while ft_prepare_bemmodel is running: </div><div><br></div><div><font color="#330099">Fatal error in dipoli:  interface /private/tmp/tpd8a04422_e19e_4978_9b9b_56d1f2696492.tri and /private/tmp/tp313c9a32_1991_4df6_a404_8efc41b6302e.tri intersect </font></div>

<div><font color="#330099"> at vertex 1402 of /private/tmp/tpd8a04422_e19e_4978_9b9b_56d1f2696492.tri</font></div><div><font color="#330099"><br></font></div><div><font color="#330099"> Warning: an error ocurred while running dipoli </font></div>

<div><font color="#330099">> In dipoli at 94</font></div><div><font color="#330099">  In ft_prepare_bemmodel at 112</font></div><div><font color="#330099">Error using ==> fread</font></div><div><font color="#330099">Invalid file identifier.  Use fopen to generate a valid file identifier.</font></div>

<div><font color="#330099">Warning: File '/private/tmp/tp0c0779e3_a657_4ca5_b9e1_845f41e9574a.ama' not</font></div><div><font color="#330099">found. </font></div><div><font color="#330099">> In dipoli at 102</font></div>

<div><font color="#330099">  In ft_prepare_bemmodel at 112</font></div><div><br></div><div><br></div><div>and the output vol is missing .mat, which causes an error during ft_sourceanalysis. </div>







<div><font color="#330099">>> vol</font></div><div><font color="#330099">vol = </font></div><div><font color="#330099">            cond: [0.3300 0.0041 0.3300]</font></div><div><font color="#330099">             bnd: [1x3 struct]</font></div>

<div><font color="#330099">          source: 3</font></div><div><font color="#330099">    skin_surface: 3</font></div><div><font color="#330099">            skin: 1</font></div><div><font color="#330099">            type: 'dipoli'</font></div>

<div><div><br></div><div>Does anyone know how to correct for "fatal error" so that ft_prepare_bemmodel creates the correct volume conduction model? I opened .tri file and removed line 1402, but got the same results.</div>

<div><br></div><div>Thanks in advance! Akiko  </div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><font><span style="font-family:arial,helvetica,sans-serif">Akiko Ikkai, Ph.D. <br>Postdoctoral Fellow<br style="font-family:arial,helvetica,sans-serif">

</span></font><font style="font-family:arial,helvetica,sans-serif" face="'PrimaSans BT,Verdana,sans-serif'" size="2">Department of 
Psychological and Brain Sciences<br>Johns Hopkins University<br>Ames 
Hall, 3400 N. Charles St.<br>Baltimore, MD 21218</font><br style="font-family:arial,helvetica,sans-serif"><br><br>
</font></span></div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br>