[FieldTrip] simulated EEG to simulated MEG

Saeed Zahran saeedzahran at hotmail.com
Tue Feb 7 10:29:03 CET 2017



Goodmorning,


How do you convert the simulated EEG to simulated MEG,

Its possible to convert the electrical potential generated at each cells to

magnetic potential? without modelling the MEG


Best regards

 Saeed Zahran

________________________________
From: fieldtrip-bounces at science.ru.nl <fieldtrip-bounces at science.ru.nl> on behalf of fieldtrip-request at science.ru.nl <fieldtrip-request at science.ru.nl>
Sent: Monday, February 6, 2017 1:00 PM
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 75, Issue 7

Send fieldtrip mailing list submissions to
        fieldtrip at science.ru.nl

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
fieldtrip Info Page - mailman.science.ru.nl<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
mailman.science.ru.nl
FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being developed by a team of researchers at the Donders Institute for Brain, Cognition and ...


or, via email, send a message with subject or body 'help' to
        fieldtrip-request at science.ru.nl

You can reach the person managing the list at
        fieldtrip-owner at science.ru.nl

When replying, please edit your Subject line so it is more specific
than "Re: Contents of fieldtrip digest..."


Today's Topics:

   1. Re: Starting at ft_timelockstatistics (Danielle Farrar)
   2. Re: Starting at ft_timelockstatistics (Mait? Crespo Garc?a)
   3. Re: Symmetric Source Reconstruction
      (Schoffelen, J.M. (Jan Mathijs))
   4. Re: Error reading fif file during ft_read_headshape
      (Schoffelen, J.M. (Jan Mathijs))


----------------------------------------------------------------------

Message: 1
Date: Sun, 5 Feb 2017 20:52:34 -0500
From: Danielle Farrar <danielle.farrar at gmail.com>
To: fieldtrip at science.ru.nl
Subject: Re: [FieldTrip] Starting at ft_timelockstatistics
Message-ID:
        <CAN1QL1O4-1moj846_Ni=DWLzwg39+XCwfsrrt_OXhxgF7Y_Vow at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello,

Just a quick question to follow up on this. I've gotten a bit further on
this question, but now am stuck because ft_timelockstatistics requires a
cfg.design field.  I was wondering how to construct this field?  I haven't
been able to find an example in the documentation.

Thanks,
Danielle

On Tue, Jan 31, 2017 at 11:40 AM, Danielle Farrar <danielle.farrar at gmail.com
> wrote:

> Hello,
>
> My apologies if this has been covered before, I just joined the list and
> am having trouble searching the archives.
>
> I have a set of EEG data that was recorded from a Biosemi apparatus using
> a 128-channel cap. The dataset is in text files, is post-processed and is
> the result of filtering, epoching, and averaging, and has been imported
> into matlab.  I created trial structs out of the datasets.  It is a dataset
> of 21 subjects with two conditions.  I'm trying to do some non-parametric
> clustering statistics on the dataset and I don't have access to the
> original bdf files.
>
> I have the electrode names and coordinates saved in matlab matrices.  Now,
> I'd like to do clustering analysis using a monte carlo simulation to
> determine areas of significant differences between the two conditions, but
> am having trouble ensuring that my datasets are structured appropriately
> for input. It seems that the tutorials mostly assume that the data is in a
> raw output format from one of the systems.
>
> I know that for ft_timelockstatistics, the data is supposed to be output
> from the ft_timelockanalysis. I was trying to use ft_timelockanalysis as an
> entry point  However, I am having trouble constructing the data struct
> appropriate for the timelock function.  Can this be done?  Should I be
> starting further upstream? I'm attaching some of the code. I'm know the
> data struct needs additional information but am not sure how to go about
> using it.
>
> The error I get when I run the following code is "Error using ft_checkdata
> (line 480). This function requires raw+comp or raw data as input."
>
> Thanks!
> Danielle
>
> ********************************
>
> for i=size(CD_condition.data,3),
>       CD_trial{i} = CD_condition.data(:,:,i);
> end
>
> CD.trial = CD_trial;
>
> cfg.channel = 'all';
> cfg.trials = 'all';
> cfg.covariance = 'yes';
> cfg.covariancewindow = 'prestim';
> cfg.removemean = 'yes';
> cfg.vartrllength = 0;
>
> CD.type = 'raw+comp';
> ft_timelockanalysis(cfg,CD);
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170205/36b69b08/attachment-0001.html>

------------------------------

Message: 2
Date: Mon, 6 Feb 2017 08:28:31 +0000 (UTC)
From: Mait? Crespo Garc?a <maity_winky at yahoo.es>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Starting at ft_timelockstatistics
Message-ID: <264055019.2734773.1486369711622 at mail.yahoo.com>
Content-Type: text/plain; charset="utf-8"

Hello Danielle,
the links below may help you to configure the design field.

Best wishes,Mait?

http://www.fieldtriptoolbox.org/development/designhttp://www.fieldtriptoolbox.org/walkthrough#paired_comparison





    El Lunes 6 de febrero de 2017 3:10, Danielle Farrar <danielle.farrar at gmail.com> escribi?:


 Hello,
Just a quick question to follow up on this. I've gotten a bit further on this question, but now am stuck because ft_timelockstatistics requires a cfg.design field.? I was wondering how to construct this field?? I haven't been able to find an example in the documentation.
Thanks,Danielle
On Tue, Jan 31, 2017 at 11:40 AM, Danielle Farrar <danielle.farrar at gmail.com> wrote:

Hello,
My apologies if this has been covered before, I just joined the list and am having trouble searching the archives.
I have a set of EEG data that was recorded from a Biosemi apparatus using a 128-channel cap. The dataset is in text files, is post-processed and is the result of filtering, epoching, and averaging, and has been imported into matlab.? I created trial structs out of the datasets.? It is a dataset of 21 subjects with two conditions.? I'm trying to do some non-parametric clustering statistics on the dataset and I don't have access to the original bdf files.
I have the electrode names and coordinates saved in matlab matrices.? Now, I'd like to do clustering analysis using a monte carlo simulation to determine areas of significant differences between the two conditions, but am having trouble ensuring that my datasets are structured appropriately for input. It seems that the tutorials mostly assume that the data is in a raw output format from one of the systems. ?
I know that for ft_timelockstatistics, the data is supposed to be output from the ft_timelockanalysis. I was trying to use ft_timelockanalysis as an entry point ?However, I am having trouble constructing the data struct appropriate for the timelock function.? Can this be done?? Should I be starting further upstream? I'm attaching some of the code. I'm know the data struct needs additional information but am not sure how to go about using it. ?
The error I get when I run the following code is "Error using ft_checkdata (line 480). This function requires raw+comp or raw data as input."
Thanks!Danielle
****************************** **
for i=size(CD_condition.data,3),? ? ? CD_trial{i} = CD_condition.data(:,:,i);end
CD.trial = CD_trial;
cfg.channel = 'all';cfg.trials = 'all';cfg.covariance = 'yes';cfg.covariancewindow = 'prestim';cfg.removemean = 'yes';cfg.vartrllength = 0;
CD.type = 'raw+comp';ft_timelockanalysis(cfg,CD);




_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
fieldtrip Info Page - mailman.science.ru.nl<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
mailman.science.ru.nl
FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being developed by a team of researchers at the Donders Institute for Brain, Cognition and ...




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

------------------------------

Message: 3
Date: Mon, 6 Feb 2017 08:40:04 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Symmetric Source Reconstruction
Message-ID: <3E18DBC0-CAA4-4C3D-8F6C-AFAC5AB5A21D at donders.ru.nl>
Content-Type: text/plain; charset="us-ascii"

Hi Behzad,

You could try to do the following, before calling ft_sourceinterpolate:

sourceC.pos = sourceC.pos(:,1:3);

Best,
Jan-Mathijs




J.M.Schoffelen, MD PhD
Senior Researcher, VIDI-fellow
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands





> On 26 Jan 2017, at 17:36, Behzad Iravani <behzadiravani at gmail.com> wrote:
>
>
> Dear FieldTrip experts ,
>
> I'm interested to perform symmetric source reconstruction on time lock data. However I encountered an error. here is my code:
>
> cfg                         = [];
> cfg.grid.unit            = 'mm';
> cfg.grid.resolution   = 5;
> cfg.grid.tight           = 'yes';
> cfg.inwardshift        = -2;
> cfg.headmodel        = vol;
> cfg.symmetric        ='y';  % symmetric sources
>
> grid                = ft_prepare_sourcemodel(cfg);
>
>
> % timelock data for two conditions
>
> load timelockA     %co-variance computed
> load timelockB     %co-variance computed
> load timeloackAB %co-variance computed
>
> load elecfile.mat   % sensor positions
> load vol.mat         % pre-compute head model
>
> cfg                     = [];
> cfg.method         = 'lcmv';
> cfg.grid               = grid;
> cfg.headmodel     = vol;
> cfg.elec               = elecfile;
> cfg.keepfilter        = 'yes';
> source                = ft_sourceanalysis(timeloackAB); % compute common filter
>
> cfg.keepfilter        = 'no';
> cfg.grid.filter         =source.avg.filter
> sourceA               = ft_sourceanalysis(timeloackA); % compute common filter
>
> sourceB               = ft_sourceanalysis(timeloackA); % compute common filter
>
>
> % Contrast Condition A versus B
> cfg           = [];
> cfg.parameter = 'pow';
> cfg.operation = '(x1./x2-1)';
> SourceC= ft_math(cfg,sourceA ,sourceB);
>
> load mri.mat       % load anatomical image
>
> cfg            = [];
> cfg.parameter  = 'pow';
> sourcePostInt  = ft_sourceinterpolate(cfg,  SourceC ,mri);
>
> here I get error in ft_warp_apply because the grid.pos is 6*n which it is supposed to be 3*n, since I chose the symmetric option it turned to 6*n.
>
> How can I solve this problem?
>
> Thanks in advance
> Best
>
> Behzad
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
fieldtrip Info Page - mailman.science.ru.nl<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
mailman.science.ru.nl
FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being developed by a team of researchers at the Donders Institute for Brain, Cognition and ...







------------------------------

Message: 4
Date: Mon, 6 Feb 2017 08:57:13 +0000
From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Error reading fif file during
        ft_read_headshape
Message-ID: <AA46DD2B-E204-4283-ADAE-41610B9A2DAD at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Hi Alba,

The first error that you report is a low-level reading error, that may have nothing to do with fieldtrip. You may want to check which version of the mne-matlab software you are using.

The workaround you tried out is not going to work, because ft_volumedownsample only works on data that is defined on a volumetric grid of dipole positions, not on a cortical sheet.

Best,
Jan-Mathijs


J.M.Schoffelen, MD PhD
Senior Researcher, VIDI-fellow
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands




On 30 Jan 2017, at 22:53, Alba Xifra Porxas, Ms <alba.xifraporxas at mail.mcgill.ca<mailto:alba.xifraporxas at mail.mcgill.ca>> wrote:


Dear FieldTrippers,

My name is Alba Xifra Porxas and I am working in the Biosignals and Systems Analysis Lab at McGill University. Currently I am analyzing MEG data from a motor-task paradigm from young and elderly subjects. I am following the tutorial: Source reconstruction of event-related fields using minimum-norm estimate (http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate).
[http://www.fieldtriptoolbox.org/_media/logo-share.png]<http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate>

tutorial:minimumnormestimate – FieldTrip<http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate>
fieldtrip.fcdonders.nl



I am having problems reading the downsampled mesh from MNE suite. When I call FT_READ_HEADSHAPE, I receive the following error message:

>> sourcespace = ft_read_headshape('s003-oct-6-src.fif', 'format', 'mne_source');

Error using fiff_read_tag (line 178)

Only two and three dimensional matrices are supported at this time

Error in mne_read_source_spaces/read_source_space/find_tag (line 288)

                    tag = fiff_read_tag(fid,node.dir(p).pos);

Error in mne_read_source_spaces/read_source_space (line 254)

        tag2 = find_tag(this,FIFF.FIFF_MNE_SOURCE_SPACE_NEAREST_DIST);

Error in mne_read_source_spaces (line 111)

    this = read_source_space(spaces(k));

Error in ft_read_headshape (line 391)

    src = mne_read_source_spaces(filename, 1);

However, I can visualize it correctly in MNE. The command I used to create the source space is:  mne_setup_source_space --ico -6.

Since I have the meshes from FreeSurfer, I tried a workaround. I call FT_READ_HEADSHAPE using lh.orig and rh.orig, which works. I successfully coregister the source space with the sensor-space and compute source reconstruction using minimum-norm estimation. However, when I try to downsample the output of FT_SOURCEANALYSIS calling FT_VOLUMEDOWNSAMPLE before parcellation, I receive the following error:

Reference to non-existent field 'dim'.

Error in ft_volumedownsample (line 100)

xsel = 1:cfg.downsample:source.dim(1);

Even if I manually introduce this missing field ?dim?, it seems the number of vertices is too big:

>> source.dim(1) = length(source.pos);source.dim(2) = length(source.pos);source.dim(3) = length(source.pos);

>> cfg = [];cfg.downsample = 4;source_down = ft_volumedownsample(cfg,source);

Error using repmat

Maximum variable size allowed by the program is exceeded.

Error in ndgrid (line 73)

        varargout{i} = repmat(x,s);

Error in pos2transform (line 25)

[X,Y,Z] = ndgrid(x, y, z);

Error in ft_checkdata>source2volume (line 1286)

  data.transform = pos2transform(data.pos, data.dim);

Error in ft_checkdata (line 350)

      data = source2volume(data);

Error in ft_volumedownsample (line 69)

source = ft_checkdata(source, 'datatype', 'volume', 'feedback', 'no');

The source I use is as follows:

>> display(source)

source =

      time: [1x3900 double]

    inside: [255462x1 logical]

       pos: [255462x3 double]

    method: 'average'

       avg: [1x1 struct]

       cfg: [1x1 struct]

       dim: [255462 255462 255462]

Therefore, I am back to where I started. I need to read the fif file from MNE suite.

I uploaded my fif file in Dropbox. Here is the link: https://www.dropbox.com/sh/uq181l76353hd8q/AACjTu8KI_rGaXlaDMyw-Diba?dl=0
[https://cfl.dropboxstatic.com/static/images/icons128/folder_dropbox.png]<https://www.dropbox.com/sh/uq181l76353hd8q/AACjTu8KI_rGaXlaDMyw-Diba?dl=0>

fieldtrip_data<https://www.dropbox.com/sh/uq181l76353hd8q/AACjTu8KI_rGaXlaDMyw-Diba?dl=0>
www.dropbox.com
Shared with Dropbox



Could someone tell me if there is something wrong with the file or with my workaround? Any help would be really appreciated. I am using Fieldtrip version 20170118.

Best,

Alba Xifra Porxas
PhD student, Biosignals and Systems Analysis Lab
McGill University, Montr?al, Canada
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
fieldtrip Info Page - mailman.science.ru.nl<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
mailman.science.ru.nl
FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being developed by a team of researchers at the Donders Institute for Brain, Cognition and ...





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

------------------------------

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
fieldtrip Info Page - mailman.science.ru.nl<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
mailman.science.ru.nl
FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being developed by a team of researchers at the Donders Institute for Brain, Cognition and ...



End of fieldtrip Digest, Vol 75, Issue 7
****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170207/4644e8d4/attachment.html>


More information about the fieldtrip mailing list