[FieldTrip] Antw: Re: non-existent mat in BEM headmodel

Gregor Volberg Gregor.Volberg at psychologie.uni-regensburg.de
Fri Mar 29 07:35:16 CET 2013


Hi Ricardo,
 
I have two hints that might help. Firstly, the segmentations and the
corresponding meshes can not only intersect each other, but it can also happen
that the generated meshes are self-intersecting. This can not be seen from the
plots of the segmented brain. The probability for intersections is higher, in
my experience, with finer mesh resolutions. You could try something like [800
800 600] instead of [3000 2000 1000]. I usually do some trial and error and
then check the volumes with om_check_vol(vol), which will report any
intersections and self-intersections in the meshes. The openmeeg plugin needs
to be installed for that. 
 
Secondly, for to the '\tmp\xyz...': Some of the methods for generating
headmodels (at least I know for dipoli and openmeeg) write large temporary
files to the hard disk. They have a long random name in order to avoid that
some other data is overwritten. These files might get very large, some GB, and
they are written per default to \tmp. A while ago I had the problem the
temporary files got larger than the space that our system administrator allowed
for  \tmp. The script ran without errors, but the mat in the resulting
structure was empty.  The solution was to change the file destination folder to
something other than \tmp, which needs to be done directly within the code of
the called function (there is no cfg-option or so for that).
 
Hope that helps,
Gregor   

 
-- 
Dr. rer. nat. Gregor Volberg <gregor.volberg at psychologie.uni-regensburg.de> (
mailto:gregor.volberg at psychologie.uni-regensburg.de )
University of Regensburg
Institute for Experimental Psychology
93040 Regensburg, Germany
Tel: +49 941 943 3862 
Fax: +49 941 943 3233
http://www.psychologie.uni-regensburg.de/Greenlee/team/volberg/volberg.html
>>> Ricardo Moura <ricardoojm at gmail.com> 28.03.2013 18:39 >>>
Hi Jörn, 
thank you very much for your response!
I checked the segmentation and everything seems to be ok (as far as I can
say... No error messages were shown during the processing and I checked the
generated objects and plots).

But I had a strange error while preparing the head model. Somehow the command
cannot find the dipoli files, even thought they are really where they should
be. And the second message ("/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama'")
I really have no clue of what it means.

And I am running this command on a ubuntu 12.04 32-bit.

Do you have any idea of how I can solve it?

Thanks once again,Best,
Ricardo

using the executable
"/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli"
/tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh: 3:
/tmp/tpd4e382c9_74a1_402d_be1a_6d2c82e749cc.sh:
/usr/local/MATLAB/R2012a/toolbox/fieldtrip-20130314/external/dipoli/dipoli: not
found
Warning: an error ocurred while running dipoli 
> In ft_headmodel_dipoli at 201
In ft_prepare_headmodel at 226 

Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.
Warning: File '/tmp/tp2619f3f3_574d_478a_bfbb_01193b4f8e0c.ama' not found. 
> In ft_headmodel_dipoli at 209
In ft_prepare_headmodel at 226 


On 27 March 2013 13:10, Ricardo Moura <ricardoojm at gmail.com> wrote:


Dear all
I am creating a BEM model for eeg, following the appropriate tutorial, but I
have a problem when preparing the headmodel. The output I have from the
ft_prepare_headmodel command does not contain the "mat", and so, when I try to
generate the leadfield, it returns an error message due to non existent "mat".
I saw that other users had similar problem, but I haven't found a solution
though. So, what is wrong with my script?

Thanks a lot in advance!
Best,
Ricardo




load standard_mri.mat
mri_orig=mri;
disp(mri)

% Segmenting the data
cfg = [];
cfg.output= {'scalp','skull','brain'};
segmentedmri = ft_volumesegment(cfg, mri_orig);
disp(segmentedmri)
save segmentedmri segmentedmri

% MESH 
cfg=[];
cfg.tissue={'brain','skull','scalp'};
cfg.numvertices = [3000 2000 ( tel:%5B3000%202000 ) 1000];
bnd=ft_prepare_mesh(cfg,segmentedmri);
disp(bnd(1)) 

% Head Model = variavel vol
cfg = [];
cfg.method ='bem_dipoli'; %dipoli singlesphere
vol = ft_prepare_headmodel(cfg, segmentedmri); 


>> disp(vol)
bnd: [1x3 struct]
cond: [0.3300 0.0041 0.3300]
skin_surface: 1
source: 3
type: 'dipoli'
unit: 'mm'
cfg: [1x1 struct]





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130329/8eb2e304/attachment.html>


More information about the fieldtrip mailing list