[FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue Mar 15 16:16:29 CET 2016


Marc,

I would not recommend to try and create a low-resolution mesh for Colin’s brain. In some sense, Colin’s brain is not more special than any of your single subject brains. In other words, you could pick any of your single subjects, and use that for visualization.
If you would like to visualize your results on a ‘average’ brain, I’d recommend the Conte69 brain, that has been developed at Washington University (the Caret people).

As a side note, Caret development is discontinued by the WashU group. They have moved to connectome workbench, which has most of the functionality supported by Caret. Specfically, there’s now also a freesurfer_to_fs_LR script that uses wb_command (the command line utility of connectome workbench). Note 2: the *.coord.* and *.topo.* files are old style Caret. Nowadays, the topologies are represented in a single file *.surf.* (rather than the positions in the coord and the triangles in the topo).

BEst,
JM




On 14 Mar 2016, at 23:09, Marc Recasens <recasensmarc at gmail.com<mailto:recasensmarc at gmail.com>> wrote:

Dear Jan-Mathijs, Sara and FT community,

I'd like to bring up this old thread which I think might be of interest us all. I don't know if there's been any new development on the MNE approach (?) since this thread was started one year ago. Anyway, in order to get template-registered surfaces that allow for inter-subject comparison/averaging, I tried using Jan-Mathijs suggestion to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR.

- I managed to get the .coord and .topo files using CARET
- I managed to create 8196 pnt mesh ( using "mne_setup_source_space --ico -6") registered to the template (fsaverage I assume) using the following files. Actually I'm not 100% sure these are the correct files I should read (the output seems to make sense though):
ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.midthickness_orig.164k_fs_LR.coord.gii']});  % for rh/lh.orig
ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.sphere.164k_fs_LR.coord.gii']});  % for rh/lh.sphere
ft_read_headshape({[%SubjectID.%Hemisphere.164k_fs_LR.topo.gii'] [%SubjectID.%Hemisphere.white_orig.164k_fs_LR.coord.gii']});  % for rh/lh.white (JM did not say anything about rh/lh.white but mne_setup_source_space required it)

- I got the resulting template-registered sourcespace properly co-registered in the correct coordinate system (individual sensor space)
- and successfully applied MNE on the template-registered sourcespace. Sources make sense are meshes are exchangeable across subjects (which I think makes sense since they're all registered to a template).

HOWEVER, I'm stuck in what I think should be a rather straight forward step, which is the creation of a template sourcemodel/grid (from the fsaverage or Colins brain) that I can use in the same way as the MNI-aligned template grid is used; that is a Talairach aligned surface with 8196 pnts that I can. I tried to use the 'cortex_8196.surf.gii' like in the lines below, but without success (because of  MNI instead of TAL aligned?):

template_sourcemodel = ft_read_headshape('cortex_8196.surf.gii');
template_sourcemodel = ft_convert_units(template_sourcemodel, 'cm');
bnd.pnt = template_sourcemodel.pnt;
bnd.tri = template_sourcemodel.tri;

Any ideas about how to get such a template mesh will be highly appreciated!

Best wishes
Marc


On Thu, Oct 1, 2015 at 4:07 PM, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:
Hi Sara,

What you need are some of the .coord files, and the .topo files.

Specifically, the midthickness_orig and the sphere files should be converted into a format that the mne-software can work with.
The only way I managed this, was to convert the gifti files back into freesurfer’s format:

tmp = ft_read_headshape({‘something-something.topo.gii’ ‘somethingelse-.L.midthickness_orig.coord.gii’});
ft_write_headshape(‘lh.orig’, tmp, ‘format’, ‘freesurfer’);

and likewise for the right hemisphere, as well as for the spheres.

Then, you can proceed with using mne_setup_source_space to create the 8196 mesh. The final tricky thing eventually is to get the stuff properly co-registered in the correct coordinate system  again, but this should proceed in the same way as when you would have used non-surface registered meshes.

The creation of the volume conduction model is a separate step (and does not require the cortical meshes).

Best,
Jan-Mathijs


On Oct 1, 2015, at 4:48 PM, Sara Aurtenetxe <s.aurtenetxe at bcbl.eu<mailto:s.aurtenetxe at bcbl.eu>> wrote:

> Dear Jan Mathijs,
>
> Thank you very much for your quick and detailed answer!
>
> As suggested, I post-processed the surface of one of my subjects based on the recipe on the link.
> The process resulted into a bunch of files (e.g. .L.164k_fs_L.topo.gii, .L.white_mni.164k_fs_LR.coord.gii, .L.def_sphere.164k_fs_L.coord.gii),
> but at this point I am not sure about how to proceed. So I have now several questions:
>
> - Do you know which are the files containing the registered data for the creation of the meshes?
>  How should I create them given the current format? most are .gii files.
> - Once creating the meshes, should I follow with the creation of the volume conduction model
>  and analysis of the functional data as described in the tutorial? http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate
>
> Apologize for all these specific questions but it is being a little bit confusing to me.
> So if anyone has experienced the same and/or have any suggestion, any comment would be very welcomed.
>
> Thanks a lot in advance,
>
> Best,
>
> Sara
>
>
>
>
>
>
>
> ----- Original Message -----
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
> To: "FieldTrip discussion list" <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
> Sent: Wednesday, September 30, 2015 9:33:03 AM
> Subject: Re: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE
>
> Hi Sara,
>
> I think that in this case there is no absolutely ‘correct’ approach, although some approaches may make more sense than others.
> At this point in time it is indeed not well documented how to proceed from individual subject results source-reconstructed onto an individual cortically constrained mesh to a group analysis.
> In the past, we have been working with a procedure where the surface data were interpolated onto a 3D-grid so that we could use volumetric normalization techniques in order to get the subjects into a common space to allow for group statistics. So, here the order of the steps would be to call ft_sourceinterpolate, followed by ft_volumenormalise, or to interpolate the functional data directly onto a MNI-warped grid (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space).
> In the code you pasted in your e-mail message, there is also reference to ft_volumerealign, but I am not sure I understand why this is a required step at this point in the pipeline.
>
> All the above being said, nowadays I would advocate a slightly different approach, which bypasses the volumetric interpolation, where per subject I would use cortical meshes that is surface-registered to a template mesh, which as a consequence allows for direct comparison of source locations across subjects. The way to achieve this would be to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. After this registration step, the low-resolution (i.e. in this case the 8196-vertex) meshes can be created.
>
> Best wishes,
> Jan-Mathijs
>
>
>
>
> Jan-Mathijs Schoffelen, MD PhD, Senior researcher
>
> Max Planck Institute for Psycholinguistics
> Donders Centre for Cognitive Neuroimaging
>
> E-mail: j.schoffelen at donders.ru.nl<mailto:j.schoffelen at donders.ru.nl>
> Telephone: +31-24-3614793<tel:%2B31-24-3614793>
>
> http://www.fieldtriptoolbox.org<http://www.fieldtriptoolbox.org/>
> http://www.hettaligebrein.nl<http://www.hettaligebrein.nl/>
>
>
>
> On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe <s.aurtenetxe at bcbl.eu<mailto:s.aurtenetxe at bcbl.eu>> wrote:
>
>> Dear all,
>>
>> I am working on the source analysis of ERF data from ElektaNeuromag system, with individual T1s, using minimum-norm estimate as described in the following tutorial:
>> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate
>> I am exactly following the suggested steps, and so got the source estimation for each of my subjects (bellow the output for one subject), which i can nicely plot with the ft_plot_mesh function:
>>
>> sourceest =
>>
>>     time: [1x1401 double]
>>   inside: [8196x1 logical]
>>      pos: [8196x3 double]
>>   method: 'average'
>>      avg: [1x1 struct]
>>      cfg: [1x1 struct]
>>
>> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics,
>> I am trying to normalise (ft_volumenormalise) and interpolate (ft_sourceinterpolate) the functional and anatomical data.
>>
>> However, I am struggling in this two last steps.
>> Since I did not find a clear pipeline/tutorial about the exact approach (am I missing something?)
>> and after trying several options (bellow I copy the code I am using), it is not clear to me:
>>
>> - which is the exact input data for each of these last two functions, and
>> - in which order they should be called.
>>
>> Now, I would highly appreciate if anyone could give me any cue about which the correct approach is.
>>
>> Thank you in advance,
>>
>> All the best,
>>
>> Sara
>>
>>
>>
>> %%%%%%%%%%%%
>>
>> % Inverse solution
>> cfg        = [];
>> cfg.method = 'mne';
>> cfg.grid   = leadfield;
>> cfg.vol    = vol;
>> cfg.mne.prewhiten = 'yes';
>> cfg.mne.lambda    = 3;
>> cfg.mne.scalesourcecov = 'yes';
>> cfg.senstype = 'MEG';
>>
>> sourceest  = ft_sourceanalysis(cfg,erf);
>>
>> % read T1 volume - coords in scanner space
>> mri = ft_read_mri('s01.nii');
>> mri.coordsys = 'neuromag';
>>
>> % read headshape - Neuromag coords
>> hsf = 's01.fif';
>> [headshape] = ft_read_headshape(hsf);
>>
>> % align T1 with head posiiton in MEG
>> cfg = [];
>> cfg.method = 'headshape';
>> cfg.parameter      = 'anatomy';
>> cfg.headshape.headshape = headshape;
>> cfg.headshape.interactive = 'no';
>>
>> mri_real = ft_volumerealign(cfg,mri);
>>
>> % normalize the realinged individual MRI to SPM template
>> cfg = [];
>> cfg.spmversion  = 'spm8';
>> % cfg.template='T1.nii'; % when enabling this field, an incoming error message indicates that the template is not in the spm coordinate system.
>>                         % However, is the one used by default in this function (as mentioned in the reference) so it is confusing to me
>>
>> norm_mri = ft_volumenormalise(cfg,mri_real);
>>
>> % interpolate Source with MEG-aligned T1
>> cfg            = [];
>> cfg.parameter = 'all';
>> cfg.downsample = 2;
>>
>> source_int  = ft_sourceinterpolate(cfg, sourceest,norm_mri);
>>
>> %%%%%%%%%%%%%%
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



--
Marc Recasens
Tel.: +34 639 24 15 98
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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


More information about the fieldtrip mailing list