[FieldTrip] Forward solution using concentric spheres and BEM models

Micheli, C. c.micheli at fcdonders.ru.nl
Mon Sep 5 12:59:37 CEST 2011


Dear Juan Pablo and Margit

The function 'ft_prepare_mesh' takes care of triangulating every compartment via the cfg.tissue option. This option contains the integers which describe a type of tissue, given that the user beforehand defined all voxels of the segmented MRI compartment as having that particular value.
As an example, download the sample MRI in FieldTrip ftp location:

ftp://ftp.fcdonders.nl/pub/fieldtrip/tutorial/Subject01.zip
Create a folder and unzip these files.

% read in the mri
mri = ft_read_mri('Subject01.mri');

% segment it
cfg = [];
cfg.output = {'scalp', 'skull', 'brain'};
seg = ft_volumesegment(cfg, mri);

% assign a label
scalp = (seg.scalp) & ~(seg.skull | seg.brain);
skull = 2*(seg.skull);
brain = 3*(seg.brain);
mri_segment = scalp + skull + brain;

% build the meshes
cfg             = [];
cfg.method      = 'segmentation';
cfg.tissue      = [1 2 3]; % scalp = 1; skull = 2; brain = 3;
cfg.numvertices = [2000 1000 800];
cfg.sourceunits = 'mm';
cfg.mriunits    = 'mm';
bnd = ft_prepare_mesh(cfg, mri_segment);

If any of the tissues has a different value from cfg.tissues this won't be triangulated. To check for this use ft_sourceplot in the interactive mode. By clicking around you can see the tissue's value in the command window:

% view the labelled segmentations
mri2 = mri;
mri2.seg = mri_segment;
cfg=[];
cfg.interactive = 'yes';
cfg.funparameter = 'seg';
ft_sourceplot(cfg,mri2);

About the concentric spheres:
both ways to derive a concentric spheres model are correct. In one case you directly build the vol structure and you assume you know the radiuses of your spheres. In the other case you allow the ft_prepare_concentricspheres function to build the spheres starting from realistic geometrical boundaries.
The second approach is my favorite because the ft_prepare function contains a function that fits a sphere to each boundary and I don't have to do it myself.
The first approach (directly force the radiuses in your vol structure) is preferable if you derive the information from other software (e.g. CTF's MRIView) or if you fit the sphere yourself.

@Pablo
If the sphere is fitted inside the brain it is correct. You do not want the sphere to include other tissues, because your assumption for the construction of the forward model is that the tissue inside the sphere is homogeneous.
For a more realistic model (encompassing the whole brain volume) I would rather use a BEM model.

I hope this helps,
Cristiano



----- "Margit Schönherr" <Margit.Schoenherr at uk-erlangen.de> schreef:

> Van: "Margit Schönherr" <Margit.Schoenherr at uk-erlangen.de>
> Aan: "Email discussion list for the FieldTrip project" <fieldtrip at donders.ru.nl>
> Verzonden: Vrijdag 19 augustus 2011 17:23:34
> Onderwerp: Re: [FieldTrip] Forward solution using concentric spheres and	BEM	models
>
> Hello Juan Pablo,
> 
> I am using fieldtrip-20110603.
> Now that you say, that your problem persisted, I remember having
> changed the code of prepare_mesh_segmentation. You find the function
> in the private directory. In line 25, it sets cfg.tissue = 1 if mri
> has fields 'brain' or 'scalp'. I think this explains why the
> segmentation is done for compartment 1 only. So I have simply
> commented this line, so that cfg.tissue is left unchanged, and the
> segmentation is done for all compartments.
> 
> I know that this is bad style, but I wanted to get it working. And
> since I was relatively new to fieldtrip, I hesitated to ask the
> discussion list...
> 
> I hope this helps. And I'm open for better solutions.
> Best,
> Margit
> 
> 
> ________________________________________
> Von: fieldtrip-bounces at donders.ru.nl [fieldtrip-bounces at donders.ru.nl]
> im Auftrag von Juan Pablo Neira [jpnv2006 at gmail.com]
> Gesendet: Freitag, 19. August 2011 16:01
> An: Email discussion list for the FieldTrip project
> Betreff: Re: [FieldTrip] Forward solution using concentric spheres and
> BEM      models
> 
> Thank you Margit for your help,
> 
> I tried your sugestion to create the geometrical description of the
> brain, skull and scalp but
> I am still having the same output bnd = 1x1 struct (pnt and tri just
> of the brain).  I should have
> bnd = 1x3 struct (pnt and tri of the brain, skull and scalp).
> 
> This is the information in the command line in matlab
> not downsampling brain
> not downsampling scalp
> not downsampling skull
> using the segmentation approach
> using the segmented MRI
> triangulating the boundary of compartment 1
> segmentation compartment 1 of 1 completed
> 
> Can you tell me which version of fieldtrip (fieldtrip-yyyymmdd) are
> you using so i could compare the code of the
> function ft_prepare_mesh.
> 
> Regards,
> 
> Juan Pablo
> 
> 2011/8/18 Schönherr, Margit <Margit.Schoenherr at uk-erlangen.de>:
> > Hello,
> >
> > I probably cannot help you with all your questions, but currently
> I'm also dealing with MRI segmentation and volume conductors, so maybe
> my solutions can be useful for you.
> > Concerning your point 5 (geometrical description of the brain,
> skull, and scalp), I have done it the following way:
> >
> > cfg             = [];
> > cfg.method      = 'segmentation';
> > cfg.tissue      = [1 2 3]; % scalp = 1; skull = 2; brain = 3;
> > cfg.numvertices = [2000 1000 800];
> > cfg.sourceunits = 'mm';
> > cfg.mriunits    = 'mm';
> > bnd = ft_prepare_mesh(cfg, mri_segment);
> >
> > I think you have to specify a vector 'cfg.numvertices', a number of
> vertices for each compartment.
> > By the way, at the beginning of ft_prepare_mesh the cfg-field
> 'numcompartments' is removed from the cfg structure (at least in my
> fieldtrip version, which is not the latest).
> >
> > Another question that comes to me is, why you need the segmented MRI
> for a concentric spheres volume conductor? So, regarding point 6, you
> can build such a vol-structure for example like this:
> >
> > vol.unit = 'm';
> > vol.o = origin;
> > vol.r = [R_brain R_skull R_skin];
> > vol.c = [1 1/80 1];
> >
> > By this, you can also define the radius as you like.
> >
> > Best,
> > Margit
> >
> >
> >
> >
> > ________________________________________
> > Von: fieldtrip-bounces at donders.ru.nl
> [fieldtrip-bounces at donders.ru.nl] im Auftrag von Juan Pablo Neira
> [jpnv2006 at gmail.com]
> > Gesendet: Mittwoch, 17. August 2011 14:58
> > An: fieldtrip at donders.ru.nl
> > Betreff: [FieldTrip] Forward solution using concentric spheres and
> BEM models
> >
> > Hello,
> >
> > I am working with an individual MRI and EEG data to do the forward
> > solution with two different volume's model (concentric spheres and
> > BEM),
> > so at the end i can compare the results.  But i did not have the
> > expected results of the concentric spheres model until now.
> >
> > This is my script:
> >
> > 1.  Read individual MRI
> > mri=ft_read_mri('data_patient_1\******.hdr');
> >
> > %I got this "Warning: flipping 1st dimension (L-R) to obtain volume
> in
> > neurological convention"
> >
> > %How can i do a homogenous transformation matrix, using the voxel
> dimensions
> > %that are specified in hdr.dime.pixdim?
> >
> > 2. Realign to 'head coordinates'
> >
> > 3. MRI Reslicing
> >
> > 4. MRI segmentation: (brain, skull,scalp)
> >
> > 5. Create geometrical description of the brain, skull and scalp (3
> compartments)
> >
> > cfg                 = [];
> > cfg.interactive     = 'no';     %segmentation method
> > cfg.numvertices     = 3000;
> > cfg.sourceunits     = 'mm';
> > cfg.downsample      = 2;
> > cfg.numcompartments = 3;
> > cfg.tissue          = {'brain' 'skull' 'scalp'};
> > cfg.smooth          = 'yes';
> > bnd                 = ft_prepare_mesh(cfg, mri_segment);
> >
> > %The output just give me the geometrical description of the brain.
> > How can i get the geometrical description of
> > %the skull and scalp also to proceed to create a 3 spheres
> concentric
> > sphere model?
> >
> > 6.  If i have the 3 geometrical descriptions (brain, skull and
> scalp).
> >  Create a 3 concentric spheres model.
> >
> > cfg                 = [];
> > cfg.headshape       = [bnd1 bnd2 bnd3];   % brain- skull - scalp
> > cfg.conductivity    = [0.33 0.0042 0.331];
> > [vol, cfg]          = prepare_concentricspheres(cfg);
> >
> > %I got the model but part of the brain is outside of its sphere and
> > also the skull.  How can I increase the radius so
> > % the whole brain will be inside its sphere and also the skull? 
> The
> > sphere of the scalp fix good.
> >
> > I hope someone can help me solve these questions.
> >
> > Regards,
> >
> > Juan Pablo
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list