[FieldTrip] Fwd: [Fwd: Yum & rpm code dependencies for OpenMEEG]

Micheli, C. c.micheli at fcdonders.ru.nl
Tue Sep 20 12:29:58 CEST 2011


Hi Steve and Alexandre

Since this topic might be of interest for a bigger audience I took the liberty of forwarding it to the official discussion list.

The pipeline to run the OpenMEEG forward solver is quite standard in FieldTrip. We have put effort in making things as general as possible. In principle the same pipeline can be used to generate other forward solutions.
In your case, you have the mesh from Freesurfer and you want to generate a 'volume conductor structure', which will be fed to the ft_compute_leadfield function.
The function to generate the vol structure is ft_prepare_headmodel.
In FieldTrip code:

% this is the FreeSurfer surface
bnd = ft_read_headshape('filename');

% this generates a 'vol' structure (one boundary)
cfg=[];
cfg.method = 'openmeeg';
cfg.geom   = bnd;
cfg.conductivity = 1;
vol = ft_prepare_headmodel(cfg);

Assuming you know the positions of your sensors, the next step will be:

[vol,sens]=ft_prepare_vol_sens(vol,sens); % this makes the vol and the elec structure compatible 

% this generates a grid of source points for your forward solution
cfg = [];
cfg.pos = pos; % the positions of the dipoles
gridfwd = ft_prepare_sourcemodel(cfg,vol,sens);

% this calculates the lead fields 
cfg=[];
cfg.channel = 'all';
cfg.vol  = vol;
cfg.grid = gridfwd;
cfg.elec = sens; % use cfg.grad for MEG data
gridfwd  = ft_prepare_leadfield(cfg);

Take care that dipoles, electrodes and surfaces are expressed in the same coordinates system (and coregistered).
Moreover you should know that some surface triangulations work better than others for a BEM method.
Here I am implicitly assuming that you have one single boundary (must be a closed surface for BEM) and that the surface is a 
smooth rendering of the inner skull.

I hope this helps

Best regards,
Cristiano








----- "Alexandre Gramfort" <gramfort at nmr.mgh.harvard.edu> schreef:

> Van: "Alexandre Gramfort" <gramfort at nmr.mgh.harvard.edu>
> Aan: sdeiss at ucsd.edu
> Cc: "c micheli" <c.micheli at fcdonders.ru.nl>
> Verzonden: Maandag 19 september 2011 23:59:23
> Onderwerp: Re: [Fwd: Yum & rpm code dependencies for OpenMEEG]
>
> Hello steve,
> 
> > I am trying to incorperate our intermediate results, which include
> a
> > freesurfer mesh, with OpenMEEG to get a new forward matrix to look
> at.
> > All I have to go on at the moment is the sample OpenMEEG script.
>  But I
> > think that leaves out a lot of the cfg fields that I have to specify
> after
> > looking at ft_prepare_bemmodel and ft_prepare_mesh that call
> OpenMEEG in
> > FieldTrip.  If I am right, is there an example script for doing
> OpenMEEG
> > with real head data as opposed to the sperical model?
> 
> I am afraid not but there should be an example of forward modeling on
> the wiki
> and the api should be the same.
> 
> maybe cristiano in CC knows?
> 
> Alex
> 
> 
> The information in this e-mail is intended only for the person to whom
> it is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you
> in error
> but does not contain patient information, please contact the sender
> and properly
> dispose of the e-mail.




More information about the fieldtrip mailing list