[FieldTrip] Concentricspheres method

Mariani Olivia olivia.mariani at epfl.ch
Fri Mar 16 11:16:39 CET 2012

Hello Cristiano,

I am using the concentricsphere but get the following errors:


??? Error using ==> ft_prepare_headmodel at 233
no input available

Error in ==> Olivia at 29
vol = ft_prepare_headmodel(cfg, seg);


My code is as follows:


%adds the path toward fieldtrip

%récupère les données du fichier mri
mri = ft_read_mri('avg152T1.nii');

%segmentation du volume
cfg = [];
cfg.coordinates = 'spm';

seg = ft_volumesegment(cfg, mri);

seg.anatomy = mri.anatomy;

cfg                = [];
cfg.tissue         = [1 2 3]; % value of each tissue type in the segmentation
cfg.numvertices    = [1000 2000 3000];
cfg.conductivity   = [1 1/80 1];
cfg.isolatedsource = true;
cfg.method         = 'concentricspheres';
cfg.smooth = 'no';

cfg.sourceunits = 'mm';
cfg.mriunits = 'mm';

vol = ft_prepare_headmodel(cfg, seg);


It seems that I never have the good conditions to put some values in "geometry" but I can't find what I am missing.

Thank you very much,

De : fieldtrip-bounces at donders.ru.nl [fieldtrip-bounces at donders.ru.nl] de la part de Micheli, C. [c.micheli at fcdonders.ru.nl]
Date d'envoi : mercredi 14 mars 2012 21:48
À : Email discussion list for the FieldTrip project
Objet : Re: [FieldTrip] Mesh intersecting BEM headmodel

Dear Olivia,
The documentation you are referring to is not up-to-date and I would not recommend to rely on it.
Notwithstanding the old documentation, the problem that you encounter is a known issue with the automatic generation of triangulated surfaces. In fact, the surfaces created from any volumetric data (anatomical MRI or segmentations) should be topologically correct for the BEM to work correctly and at the moment FieldTrip does not check for this (we are working currently on this topic).
If you plan to use a head model with 3 compartments I would recommend to start with the function ft_prepare_headmodel, and work with concentric spheres.You can call it like this:

cfg.method = 'concentricspheres';
bnd = ft_prepare_headmodel(cfg,seg)

The variable seg is the output of ft_volume_segment containing the skin, skull, brain compartments as
and you can refer to the standard documentation for this function:


This should automatically solve in most of the cases the problem of intersecting or self-intersecting surfaces.
If you want to use the openmeeg toolbox with realistic head models the analysis is complicated by the non-correctness of the surfaces topologies, due probably to the outcome of the segmentation and the successive triangulation step (which happens within the ft_prepare_bemmodel function, now obsolete).
The generation of the meshes might work straight away also with the realistic segmented compartments, but it would be difficult to visually check for surface correctness (for example by using the ft_plot_mesh function).
When you have the three surfaces you can eventually attach them to your next mail, so that I can verify things with the prototype surface management functions, that we are developing/integrating (see http://code.google.com/p/fieldtrip/source).

Let me know if this helps

Van: "Mariani Olivia" <olivia.mariani at epfl.ch>
Aan: fieldtrip at donders.ru.nl
Verzonden: Dinsdag 13 maart 2012 11:44:53
Onderwerp: [FieldTrip] Mesh intersecting BEM headmodel


I am using the "create a BEM headmodel" script but I am getting spikes and unwanted holes in the brain compartment when using the triplot function and don't know how to get rid of it.

I get the following warnings on matlab (R2011a):

!!!!!!!!!!! WARNING !!!!!!!!!!!
Mesh is self intersecting !
Mesh Info :
    # points : 1000
    # triangles : 1996
    Euler characteristic : 2
    Min Area : 14
    Max Area : 152.381
Self intersection for mesh number 2

I get this self intersecting warning for my three meshes and additional warnings that two meshes are intersecting.
My problem may come from ill-defined boundaries. Would you know how to better define the boundaries between the meshes?

And then I get the following error:

| ------ om_minverser
| ./tpa072e3c1_0eb4_4007_ba7c_1f49bd581138.bin
| ./tpaf0e1a3b_e107_4728_bbb8_1f5309bb3861.bin
| -----------------------
Exception: Unable to open the file ./tpa072e3c1_0eb4_4007_ba7c_1f49bd581138.bin for reading Doing my best....
Warning: an error ocurred while running OpenMEEG
> In openmeeg at 127
  In ft_prepare_bemmodel at 232
  In projet_mineur at 106
Error using ==> fread
Invalid file identifier.  Use fopen to generate a valid file identifier.
Warning: File 'tpa072e3c1_0eb4_4007_ba7c_1f49bd581138.bin' not found.
> In openmeeg>cleaner at 142
  In openmeeg at 129
  In ft_prepare_bemmodel at 232
  In projet_mineur at 106
Warning: File 'tpaf0e1a3b_e107_4728_bbb8_1f5309bb3861.bin' not found.
> In openmeeg>cleaner at 143
  In openmeeg at 129
  In ft_prepare_bemmodel at 232
  In projet_mineur at 106

The file om_minverser from openmeeg closes and the figures open.

Thank you,


fieldtrip mailing list
fieldtrip at donders.ru.nl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120316/6da65256/attachment-0001.html>

More information about the fieldtrip mailing list