[FieldTrip] Specific sources and ft_sourcestatistics

Laura Rueda Delgado Laura.Rueda at faber.kuleuven.be
Tue Oct 21 10:17:42 CEST 2014


Dear all and Max,

Thank you for your comment.

I think I wasn’t clear in my previous message

I’ve added more explanation to the steps that I mentioned before:


1)      Estimate sources with the common filter for Task and Rest separately: I create the headmodel from the invidual MRI, and create the grid from the individually warped template as described in the tutorial that you suggested. I use eLORETA.

2)      Find sources (let’s call them ‘Task_vs_Rest’)that are significantly different between these two conditions (ft_sourcestatistics with dependent T): I run a cluster-based permutation on the sources after unwarping the positions to the positions of the template for group analysis.

3)      Use the position of these sources (Task_vs_Rest) as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions): I get the index of the sources Task_vs_Rest and use this index for selecting the x,y,z coordinates (grid.pos) of the individually warped template. These x,y,z coordinates are my ROIs for ft_sourceanalysis.

4)      Find sources (let’s call them ‘C1vsC2vsC3’) that account for the main effect between conditions (ft_sourcestatistics with dependent F).
My question:
I get stuck in step 4. The problem is that if I use the position of the sources Task_vs_Rest, as a way to select ROIs, I don’t have a regular grid anymore for steps 3 and 4. When using ft_sourcestatistics to find C1vsC2vsC3 (in step 4), cfg.dim needs to be specified. If I do not specify it (because I don’t have a regular grid with 3 dimensions as expected in step 4), I get the error shown in my previous message. The goal with these steps is to first obtain meaningful sources from the contrast Task (including C1, C2 and C3) vs Rest to use them for the contrast C1 vs C2 vs C3.

Please let me know if these steps make any sense, and whether and/or how I could work around this error.

Best regards,

Laura Rueda Delgado
KU Leuven - Department of Kinesiology
Movement Control and Neuroplasticity Research Group
Building De Nayer (GDN)
Tervuursevest 101 bus 1501
3001 Leuven
Belgium

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Max Cantor
Sent: maandag 20 oktober 2014 18:59
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Specific sources and ft_sourcestatistics

I found the tutorial,

http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s[]=template&s[]=grid<http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space?s%5b%5d=template&s%5b%5d=grid>

Hopefully that clarifies anything about the code.

On Mon, Oct 20, 2014 at 12:49 PM, Max Cantor <mcantor at umich.edu<mailto:mcantor at umich.edu>> wrote:
Hi Laura,

If I understand your problem correctly, what I think you need to do is create a template grid using ft_source_model, then use ft_source_model to create a grid using each subjects' mri with the template grid, and finally change the .dim and .pos parameters of the source analysis output to unwarp from the subject grid to the template grid. The following code might help, although I think there is also a tutorial that talks about this:

    template                   = ft_read_mri(templatefile);
    template.coordsys    = 'spm';

    % segment the template brain and construct a volume conduction model (i.e. head model)

    cfg                            = [];
    template_seg           = ft_volumesegment(cfg, template);

    cfg                            = [];
    cfg.method               = 'singleshell';
    template_vol             = ft_prepare_headmodel(cfg, template_seg);

    % construct the dipole grid in the template brain coordinates

    cfg                           = [];
    cfg.grid.xgrid           = -20:1:20;
    cfg.grid.ygrid           = -20:1:20;
    cfg.grid.zgrid           = -20:1:20;
    cfg.grid.unit             = 'cm';
    cfg.grid.tight            = 'yes';
    cfg.inwardshift        = -1.5;
    cfg.vol                     = template_vol;
    template_grid         = ft_prepare_sourcemodel(cfg);

   % Subject mri

    mri                          = ft_read_mri(mrifile);
    mri                          = ft_volumereslice([], mri);

    cfg                          = [];
    cfg.write                  = 'no';
    cfg.coordsys           = 'ctf';
    segmented             = ft_volumesegment(cfg, mri);

    cfg                          = [];
    cfg.method             = 'singleshell';
    vol                          = ft_prepare_headmodel(cfg, segmented);

    % Prepare Source Model using template grid and subject mri

    cfg                          = [];
    cfg.grid.warpmni     = 'yes';
    cfg.grid.template     = template_grid;
    cfg.grid.nonlinear    = 'yes';
    cfg.mri                     = mri;
    grid                          = ft_prepare_sourcemodel(cfg);

   % Unwarp Grid (For group analysis)

    src.dim                   = template_grid.dim;
    src.pos                   = template_grid.pos;

I hope this helps.
best,

Max



On Mon, Oct 20, 2014 at 12:17 PM, Laura Rueda Delgado <Laura.Rueda at faber.kuleuven.be<mailto:Laura.Rueda at faber.kuleuven.be>> wrote:
Dear all,

I’m working with EEG data and the individual MRIs. I have a doubt about a step for defining ROIs. I have EEG data during a task with 3 conditions (C1, C2, C3) and during rest. I would like to know what is the main effect of the conditions in my source data. I was recommended to use the contrast of Task (C1, C2 and C3 together) vs Rest to obtain meaningful sources, which then are used to restrict the source and statistical analysis between the conditions. This is what I do:


-          Estimate sources with the common filter for Task and Rest separately.

-          Find sources that are significantly different between these two conditions (ft_sourcestatistics with dependent T).

-          Use the position of these sources as ROIs in ft_sourceanalysis for C1, C2 and C3 separately (but using a common filter of these conditions).

-          Find sources that account for the main effect between conditions (ft_sourcestatistics with dependent F).

Now the problem is that if I use the position of the sources in ft_sourceanalysis, I don’t have a regular grid anymore, and this becomes a problem when using ft_sourcestatistics as cfg.dim needs to be specified and if I do not specify it (because I don’t have a regular grid with 3 dimensions as expected), I get the following error:

Error using reshape
To RESHAPE the number of elements must not change.

Error in clusterstat (line 185)
      posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);

Error in ft_statistics_montecarlo (line 361)
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in statistics_wrapper (line 308)
    [stat, cfg] = statmethod(cfg, dat, design);

Error in ft_sourcestatistics (line 107)
    [stat, cfg] = statistics_wrapper(cfg, varargin{:});


So does anybody know a way to work around this?

And what do you think of the logic of these steps?

Thank you in advance for any help!


Cheers,

Laura Rueda Delgado


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



--
Max Cantor
Lab Manager
Computational Neurolinguistics Lab
University of Michigan



--
Max Cantor
Lab Manager
Computational Neurolinguistics Lab
University of Michigan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141021/780492e7/attachment-0001.html>


More information about the fieldtrip mailing list