[FieldTrip] eLORETA source analysis

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Thu Oct 1 09:07:59 CEST 2020


Hi Tibor and Jefe Diego,

Thanks for letting the list know. Did you also manage to find what makes the old/new methods behave differently in this context? A fix to make the ‘old’ behave correctly would be warmly welcomed as a PR on github.

Best wishes,
Jan-Mathijs


On 1 Oct 2020, at 08:42, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Hi JM,

I would like to let you know that a colleague of mine, Diego Lozano-Soldevilla, figured it out that the issue was that the warping uses “old” spmmethods as defaults. Switching to “new” resulted in a good spatial correspondence between the headmodel and the sourcemodel.

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
tibor.auer at gmail.com<mailto:tibor.auer at gmail.com>
+44-7906-863837
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7C0da68a9196be4a4fd60108d71a70e11e%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637006944417188277&sdata=aoE%2FhNWj%2F%2F3L8fDDz4S0dMuMTlt2p05mgHaDTXddP4w%3D&reserved=0>

From: tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> <tibor.auer at gmail.com<mailto:tibor.auer at gmail.com>>
Sent: 29 September 2020 11:13
To: 'FieldTrip discussion list' <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: RE: [FieldTrip] eLORETA source analysis

Hi JM,

I can confirm that the volumes match:

mri =

  struct with fields:

          dim: [176 240 256]
      anatomy: [176×240×256 double]
          hdr: [1×1 struct]
    transform: [4×4 double]
         unit: 'mm'
       inside: [176×240×256 logical]
     coordsys: 'ras'

>> seg

seg =

  struct with fields:

          dim: [176 240 256]
    transform: [4×4 double]
         unit: 'mm'
     coordsys: 'ras'
         gray: [176×240×256 double]
        white: [176×240×256 double]
          csf: [176×240×256 double]

>> V = spm_vol(segfn);
>> V(1).mat

ans =

    1.0000         0         0  -92.7090
         0    1.0000         0 -134.8915
         0         0    1.0000 -147.5172
         0         0         0    1.0000

>> seg.transform

ans =

    1.0000         0         0  -92.7090
         0    1.0000         0 -134.8915
         0         0    1.0000 -147.5172
         0         0         0    1.0000

seg.transform is taken from mri.transform, so they are equivalent.

I have also attached two images showing spatial correspondence of the matrices based on ths code:

%%
subplot(1,2,1);
imagesc(mri.anatomy(:,:,165)); colormap(gray); axis image
subplot(1,2,2);
imagesc(seg.gray(:,:,165)>0.99); colormap(gray); axis image

%%
img = mri.anatomy/max(mri.anatomy(:))*128;
c1 = seg.gray.*(seg.gray>0.9)-0.9; c1 = c1.*(c1>0);
c1 = (c1/0.1*128+128).*(c1>0);
img = img + c1;
image(img(:,:,165)); colormap([gray(128);hot(128)]); axis image

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: Tuesday, September 29, 2020 7:11 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] eLORETA source analysis

Hi Tibor,

I don’t know what is wrong with this snippet, apart from the fact that there’s no guarantee that the volume in mri.anatomy matches (in terms of voxel dimensions and orientation) with the volumes that you load in with spm_read_vols.

JM


On 28 Sep 2020, at 23:00, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Hi JM,

Can you tell me what is wrong with the snippet below? It generates the attached image (i.e. the headmodel and the sourcemodel do not match).

FTpath = '/users/psychology01/software/fieldtrip';

mrifn = 'T1w.nii';
mri = ft_read_mri(mrifn,'dataformat','nifti_spm');
mri = ft_datatype_volume(mri);
mri.coordsys = 'ras';

segfn = char('c1.nii','c2.nii','c3.nii');
Y = spm_read_vols(spm_vol(segfn));
seg = keepfields(mri,{'dim','transform','coordsys','unit'});
seg.gray = Y(:,:,:,1);
seg.white = Y(:,:,:,2);
seg.csf = Y(:,:,:,3);
clear Y

cfg        = [];
cfg.method = 'singleshell';
headmodel  = ft_prepare_headmodel(cfg, seg);

dat = load(fullfile(FTpath,'template/sourcemodel/standard_sourcemodel3d10mm.mat'));
cfg           = [];
cfg.warpmni   = 'yes';
cfg.template  = dat.sourcemodel;
cfg.nonlinear = 'yes';
cfg.mri       = mri;
cfg.unit      ='mm';
sourcemodel   = ft_prepare_sourcemodel(cfg);

% make a figure of the single subject headmodel, and grid positions
figure; hold on;
ft_plot_headmodel(headmodel, 'edgecolor', 'none','facecolor',[0.5 0.5 0.5],'facealpha', 0.4);
ft_plot_mesh(sourcemodel.pos(sourcemodel.inside,:));

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> <tibor.auer at gmail.com<mailto:tibor.auer at gmail.com>>
Sent: Monday, September 28, 2020 5:03 PM
To: 'FieldTrip discussion list' <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: RE: [FieldTrip] eLORETA source analysis

I found it: http://www.fieldtriptoolbox.org/tutorial/sourcemodel/#make-the-individual-subjects-grid

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> <tibor.auer at gmail.com<mailto:tibor.auer at gmail.com>>
Sent: Monday, September 28, 2020 5:00 PM
To: 'FieldTrip discussion list' <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: RE: [FieldTrip] eLORETA source analysis

And how do I inverse-warp them? 😊

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: Monday, September 28, 2020 4:37 PM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] eLORETA source analysis

Dear Tibor,

Well, I meant you can use one of the standard sourcemodels, provided you inverse-warp them to individual subject space.

Best wishes,
Jan-Mathijs


On 28 Sep 2020, at 17:25, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Do you mean I could simply use <fieldtrip>/template/sourcemodel/standard_sourcemodel3d10mm.mat?

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: Monday, September 28, 2020 3:28 PM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] eLORETA source analysis

Well, the group analysis section should be sufficient.

Best wishes,

JM


On 28 Sep 2020, at 16:20, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Hi JM,

Thank you for the information.

Regarding 3D grids, the http://www.fieldtriptoolbox.org/tutorial/sourcemodel/#construction-of-a-source-model-based-on-a-regular-3-dimensional-grid-of-dipole-positions section says “Content is coming soon!”. Only the steps required for group analysis are detailed.

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: Monday, September 28, 2020 1:05 PM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] eLORETA source analysis

Hi Tibor,

Well, I don’t have a strong recommendation to go for either, apart from the fact that a distributed source reconstruction method (such as eLORETA) benefits from an accurate source model to begin with. Also, it depends on what you aim in your source reconstruction. Limiting yourself to the cortical sheet gets rid subcortical structures/cerebellum.

Regarding 3D grids, there is some stuff that relates to 3D grids, isn’t there?


Best wishes,
JM



On 28 Sep 2020, at 13:52, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Thank you, Jan-Mathijs,

This link is very instructive. I wonder why it eluded me so far. 😊

If I get it right, you recommend using approach based on the cortical sheet because 1) the tutorial for 3D grid is not there yet and 2) I can use results from cortical sheet directly for group analysis.

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: Monday, September 28, 2020 10:21 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] eLORETA source analysis

Dear Tibor,

It’s not clear to me what’s special about spm’s ‘unified segmentation’ regarding the creation of source models.

I assume you are aware that source models eventually need to be in the subject’s native space in order for them to be useable.

Documentation about how to create a source model for EEG/MEG source reconstruction can be found at: http://www.fieldtriptoolbox.org/tutorial/sourcemodel/, which might be a good starting point.

Best wishes,
Jan-Mathijs




On 28 Sep 2020, at 10:03, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Hi Jan-Mathijs,

Thank you for your response. I found that post earlier and noticed that I may need to redo the freqanalysis, however, I still do not know how do I create the sourcemodel from the T1-weighted MRI images already segmented with SPM12.

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
T.Auer at surrey.ac.uk<mailto:T.Auer at surrey.ac.uk>
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs)
Sent: Thursday, September 24, 2020 8:12 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] eLORETA source analysis

Hi Tibor,

Some of this is discussed (and fixed, there were some small issues in the code) in https://github.com/fieldtrip/fieldtrip/issues/1454 and the PR that is linked in the linked issue.

Note: if you want to go from sensor-level to source-level data in the frequency domain, you should either use ‘powandcsd’, or ‘fourier’ as cfg.output argument to ft_freqanalysis.

Best wishes,
Jan-Mathijs





On 23 Sep 2020, at 13:42, tibor.auer at gmail.com<mailto:tibor.auer at gmail.com> wrote:

Dear Community,

I would like to perform an eLORETA source analysis, however, I am unsure about the steps.

I am working on the LEMON data<http://fcon_1000.projects.nitrc.org/indi/retro/MPI_LEMON.html> including 62-channel EEG experiment at rest and structural (T1-weighted) MRI of >200 participants.

I have preprocessed the EEG data and performed timefrequency analysis on the 2-second-long epochs with configuration:

     *   method: 'mtmfft'
     *   taper: 'hanning'
     *   foi: [0.9766 1.9531 3.9062 5.8594 7.8125 12.2070 15.1367 20.0195 24.9023 32.2266 40.0391 60.0586 69.8242 80.0781 95.2148 109.8633 120.1172]
     *   pad: 2.0480
     *   output: 'pow'
     *   keeptrials: 'no'
     *   trials: [233×1 double]

I have also processed the MRI images and normalised-segmented them using SPM12’s unified segmentation outside FieldTrip.

I would appreciate any help including code snippets, pointers to (order of) functions or specific and detailed tutorials.

Kind regards,
Tibor

Auer, Tibor M.D. Ph.D.
Research Fellow
School of Psychology, Faculty of Health and Medical Sciences
University of Surrey, Guildford GU2 7XH
@TiborAuer<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FTiborAuer&data=02%7C01%7Ct.auer%40surrey.ac.uk%7Cdb32da458c424eedef2908d7d4bd1421%7C6b902693107440aa9e21d89446a2ebb5%7C0%7C0%7C637211780868086968&sdata=zrT5%2FnGGsar14C3WartuU99tzsfLu30Peh9fuaqrAUg%3D&reserved=0>

dy>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

v>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

div>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

/p>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

nbsp;

<fieldtrip.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

ss=MsoNormal>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201001/9abe491d/attachment-0001.htm>


More information about the fieldtrip mailing list