From cristinarainich at gmail.com  Mon Mar  2 23:24:20 2020
From: cristinarainich at gmail.com (Kristina Rainich)
Date: Tue, 3 Mar 2020 01:24:20 +0300
Subject: [FieldTrip] MEG NORD Deadline Extension!
Message-ID: <CA+pjZuVSw4xDgKohGzUg0xBUok93tUdDtt8fHKGNkvtcy-rhBQ@mail.gmail.com>

Dear all,

We would like to share with you an update on MEG NORD 2020 (
https://megnord.org/) happening in Moscow, Russia May 25-27th, 2020.

The *deadline *for abstract submission is extended until *16th March! *However,
if you would like to come, please let us know *as soon as possible* (by
sending an email to 2020 at megnord.org) and later you can send us the
abstract.

Let us remind you what the conference will be about: the first day there
will be a workshop on data analysis in MNE-Python held by Alex Gramfort and
the keynote lectures by Vadim Nikulin and Yoshio Okada. The second and
third days we will host the keynote lectures by Matt Brookes and Nathan
Weisz, site presentations from North European leading contributors in the
MEG field, blitz talks and poster presentations!

There is *no* cost for registration but please do send us an email if you
plan to attend. The agenda and registration can be found at the website:
https://megnord.org/.
To register please forward an email with your name, affiliation to
2020 at megnord.org and also state whether you would like to participate in
the workshop (please out the subject of the email as follows:
REGISTRATION). If you want to present a poster, please add a *title,
authors list, affiliations and abstract* (250 words max) to the letter
about registration (the subject of the email: ABSTRACT SUBMISSION).

Please note that the information on venues, lodging, poster presentation,
and a detailed schedule of the conference will be available on the MEG NORD
website in March.
We will issue an invitation letter for your VISA to Russia, and support you
with all the necessary information.

We would really appreciate if you can spread the word about the conference
to research groups, students, postdocs, etc. that you may know.

See you in Moscow!

Best Regards,
Kristina Rainich
On the behalf of MEG NORD 2020 Organization Committee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200303/f24dcf0d/attachment.htm>

From iris.steinmann at med.uni-goettingen.de  Tue Mar  3 13:03:01 2020
From: iris.steinmann at med.uni-goettingen.de (Steinmann, Iris)
Date: Tue, 3 Mar 2020 12:03:01 +0000
Subject: [FieldTrip] ft_databrowser is losing information about some
 manually marked artifacts
Message-ID: <A0898A0619E8724487198481181011B40172D555EC@umg-exc-3.ads.local.med.uni-goettingen.de>

Dear fieldtrip experts,

when I use ft_databrowser and mark trials manually as artifacts ('visual'), some (but not all) of these are again unmarked when I scroll back to them later. First I thought its maybe a problem with displaying the manually marked trials in the databrowser window, but when I close the ft_databrowser window, these trials are also not stored in the cfg.artifacts.artfctdef.visual.
I'm using MATLAB 2015 b on a Linux machine and down below is the full code I'm using for the ft_databrowser plot.

Thanks for any idea!
Cheers!

Iris

cfg = [];
cfg.channel = 'eeg';
cfg.viewmode = 'vertical';
cfg.preproc.lpfilter = 'yes';
cfg.preproc.lpfreq = 45;
cfg.artfctdef.stat.artifact = artifact_stat;
cfg.selectfeature = 'visual';
cfg.selectmode = 'markartifact';
cfg = ft_databrowser(cfg, data);



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200303/99f33098/attachment.htm>

From faby_jude at yahoo.com  Tue Mar  3 18:51:06 2020
From: faby_jude at yahoo.com (Fabian)
Date: Tue, 3 Mar 2020 17:51:06 +0000 (UTC)
Subject: [FieldTrip] Post doctoral position (Northwestern University, Chicago,
 IL)
References: <1348853689.3732244.1583257866198.ref@mail.yahoo.com>
Message-ID: <1348853689.3732244.1583257866198@mail.yahoo.com>


A postdoctoral research positions(2 years) is immediately available at the Northwestern Cognitive OculomotorOptimization Laboratory, under the direction of Drs. Daniel Corcos and FabianDavid in the Northwestern Department of Physical Therapy & Human MovementSciences. The primary focus of the lab is to understand the mechanism of actionof deep brain stimulation of the subthalamic nucleus in the context of movementand cognition in patients with Parkinson’s disease. We use a combination of invasivesubthalamic nucleus recordings, non invasive high density EEG, and behavioraltasks using eye and limb movements in patients with Parkinson’s disease. 
The successful candidates isexpected to be a team player and collaborate closely with other team members atNorthwestern and with our external collaborators to develop and validate dataacquisition protocols, behavioral testing, advanced image and signal analyses,and interpretation. The candidate will also be expected to report algorithmsand experimental findings through peer reviewed publications. In addition,opportunities to develop research proposals under direct mentorship from the PIwill be provided. 

Requirements include: 1) an interest in the therapeutic mechanismsof deep brain stimulation across motor and cognitive networks, 2) A PhD inNeuroscience, Engineering, Physics, or Data Science, or a related field, 3) Proficiencyin Matlab and/or Python, 4) Experience with electrophysiological signalanalysis (EEG and LFPs) with a strong quantitative and theoretical skill set, and5) excellent writing skills. The position is open until filled. Interestedapplicants can send a NIH style biosketch or CV, a brief statement of interest,as well as contact information for two references to: Fabian.j.David at northwestern.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200303/e91f7b49/attachment.htm>

From z65.juhasz at gmail.com  Wed Mar  4 11:38:29 2020
From: z65.juhasz at gmail.com (Zoltan Juhasz)
Date: Wed, 4 Mar 2020 11:38:29 +0100
Subject: [FieldTrip] Problem with Beamformer demo
In-Reply-To: <894A4A40-F4DB-4891-80C2-2922BC7FC488@donders.ru.nl>
References: <CANxafJ=attViuffT+a22T4AB_2_MOCb5kQC1gpyGZu6CLFFExQ@mail.gmail.com>
 <894A4A40-F4DB-4891-80C2-2922BC7FC488@donders.ru.nl>
Message-ID: <CANxafJnebdGw99z8SO5_CVRC1extBLuom2AEMPD=XeUjTEL24Q@mail.gmail.com>

Hi Jan-Mathijs,

Thanks for getting back to me. I noticed that the documentation page has
changed since my first email, so I created a new script and ran this again.
This time no data is loaded from disk during computation, I am using what
is produced by the script. The result is very disappointing, all figures
are wrong. I have uploaded the script, the execution log and the output
figures. Could you please check what could be wrong here?

The link to the files is the same as before:
https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
Matlab version: r2019a
Fieldtrip version: 20190121

Thanks,
Zoltan


On Thu, Feb 27, 2020 at 10:00 AM Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> wrote:

> Hi Zoltan,
>
>
> Have you checked the values of the numbers in the functional data prior to
> calling ft_sourceinterpolate? This would give an indication of whether it
> is an interpolation issue or not.
> I suspect that latter, because it seems that the interpolation is pulling
> ‘activity values’ into areas in the volume for which no functional estimate
> was provided.
> This could happen if the specification of the ‘inside’ field in the source
> variable, prior to interpolation, behaves unpredictably.
> Whether or not this is specific to the Matlab version used, I don’t know.
> Also, it is unclear what version of fieldtrip you are using.
>
> What I can see in your script, though, is that the sourcePost_nocon you
> use to generate the first ‘correct’ 2 figures is loaded from disk, whereas
> the other source structure (with the ‘incorrect’ interpolation) is not.
>
> Best wishes,
> Jan-Mathijs
>
>
> On 25 Feb 2020, at 13:46, Zoltan Juhasz <z65.juhasz at gmail.com> wrote:
>
> I have recently run into a problem while executing the Beamformer
> Fieldtrip demo at http://www.fieldtriptoolbox.org/tutorial/beamformer/
>
> I am using the sample data set and the source code from this page but the
> picture I get for the section "Source Analysis: Contrast activity to
> another interval" is rather strange. I include here the 3 outputs, first
> two are correct, third one is the problematic one. Also included is the
> source. Matlab version used: R2019a. Could someone check whether it is a
> script error or perhaps a change in Matlab that generates the odd result?
>
> links to figures and source:
>
> https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
>
> Thanks,
> Zoltan
> University of Pannonia, Hungary
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200304/a6318138/attachment.htm>

From S.Arana at donders.ru.nl  Wed Mar  4 13:19:13 2020
From: S.Arana at donders.ru.nl (Arana, S.L. (Sophie))
Date: Wed, 4 Mar 2020 12:19:13 +0000
Subject: [FieldTrip] Problem with Beamformer demo
In-Reply-To: <CANxafJnebdGw99z8SO5_CVRC1extBLuom2AEMPD=XeUjTEL24Q@mail.gmail.com>
References: <CANxafJ=attViuffT+a22T4AB_2_MOCb5kQC1gpyGZu6CLFFExQ@mail.gmail.com>
 <894A4A40-F4DB-4891-80C2-2922BC7FC488@donders.ru.nl>,
 <CANxafJnebdGw99z8SO5_CVRC1extBLuom2AEMPD=XeUjTEL24Q@mail.gmail.com>
Message-ID: <1583324354031.15307@donders.ru.nl>

???Dear Zoltan,


I have indeed recently updated the beamformer tutorial. I just ran it with Matlab 2019a and the most recent Fieldtrip version (available on Github) and the figures look fine to me.

Could you update your Fieldtrip version and try again?


Best,

Sophie

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Zoltan Juhasz <z65.juhasz at gmail.com>
Sent: Wednesday, March 4, 2020 11:38 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Problem with Beamformer demo

Hi Jan-Mathijs,

Thanks for getting back to me. I noticed that the documentation page has changed since my first email, so I created a new script and ran this again. This time no data is loaded from disk during computation, I am using what is produced by the script. The result is very disappointing, all figures are wrong. I have uploaded the script, the execution log and the output figures. Could you please check what could be wrong here?

The link to the files is the same as before: https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
Matlab version: r2019a
Fieldtrip version: 20190121

Thanks,
Zoltan


On Thu, Feb 27, 2020 at 10:00 AM Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:
Hi Zoltan,


Have you checked the values of the numbers in the functional data prior to calling ft_sourceinterpolate? This would give an indication of whether it is an interpolation issue or not.
I suspect that latter, because it seems that the interpolation is pulling 'activity values' into areas in the volume for which no functional estimate was provided.
This could happen if the specification of the 'inside' field in the source variable, prior to interpolation, behaves unpredictably.
Whether or not this is specific to the Matlab version used, I don't know. Also, it is unclear what version of fieldtrip you are using.

What I can see in your script, though, is that the sourcePost_nocon you use to generate the first 'correct' 2 figures is loaded from disk, whereas the other source structure (with the 'incorrect' interpolation) is not.

Best wishes,
Jan-Mathijs


On 25 Feb 2020, at 13:46, Zoltan Juhasz <z65.juhasz at gmail.com<mailto:z65.juhasz at gmail.com>> wrote:

I have recently run into a problem while executing the Beamformer Fieldtrip demo at http://www.fieldtriptoolbox.org/tutorial/beamformer/

I am using the sample data set and the source code from this page but the picture I get for the section "Source Analysis: Contrast activity to another interval" is rather strange. I include here the 3 outputs, first two are correct, third one is the problematic one. Also included is the source. Matlab version used: R2019a. Could someone check whether it is a script error or perhaps a change in Matlab that generates the odd result?

links to figures and source:
https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing

Thanks,
Zoltan
University of Pannonia, Hungary
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200304/700d1baa/attachment.htm>

From z65.juhasz at gmail.com  Wed Mar  4 13:48:41 2020
From: z65.juhasz at gmail.com (Zoltan Juhasz)
Date: Wed, 4 Mar 2020 13:48:41 +0100
Subject: [FieldTrip] Problem with Beamformer demo
In-Reply-To: <1583324354031.15307@donders.ru.nl>
References: <CANxafJ=attViuffT+a22T4AB_2_MOCb5kQC1gpyGZu6CLFFExQ@mail.gmail.com>
 <894A4A40-F4DB-4891-80C2-2922BC7FC488@donders.ru.nl>
 <CANxafJnebdGw99z8SO5_CVRC1extBLuom2AEMPD=XeUjTEL24Q@mail.gmail.com>
 <1583324354031.15307@donders.ru.nl>
Message-ID: <CANxafJnJUcDu0PfuA4i+m9=1otC=nqKPiSk=Yuj5yToZ3Y65aA@mail.gmail.com>

Dear Sophie,
Thanks fort the update. I'll try again shortly with the latest version of
fieldtrip. Will let you know about the outcome.
Zoltan

On Wed, 4 Mar 2020, 13:44 Arana, S.L. (Sophie), <S.Arana at donders.ru.nl>
wrote:

> ​​​Dear Zoltan,
>
>
> I have indeed recently updated the beamformer tutorial. I just ran it with
> Matlab 2019a and the most recent Fieldtrip version (available on
> Github) and the figures look fine to me.
>
> Could you update your Fieldtrip version and try again?
>
>
> Best,
>
> Sophie
> ------------------------------
> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Zoltan
> Juhasz <z65.juhasz at gmail.com>
> *Sent:* Wednesday, March 4, 2020 11:38 AM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] Problem with Beamformer demo
>
> Hi Jan-Mathijs,
>
> Thanks for getting back to me. I noticed that the documentation page has
> changed since my first email, so I created a new script and ran this again.
> This time no data is loaded from disk during computation, I am using what
> is produced by the script. The result is very disappointing, all figures
> are wrong. I have uploaded the script, the execution log and the output
> figures. Could you please check what could be wrong here?
>
> The link to the files is the same as before:
> https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
> Matlab version: r2019a
> Fieldtrip version: 20190121
>
> Thanks,
> Zoltan
>
>
> On Thu, Feb 27, 2020 at 10:00 AM Schoffelen, J.M. (Jan Mathijs) <
> jan.schoffelen at donders.ru.nl> wrote:
>
>> Hi Zoltan,
>>
>>
>> Have you checked the values of the numbers in the functional data prior
>> to calling ft_sourceinterpolate? This would give an indication of whether
>> it is an interpolation issue or not.
>> I suspect that latter, because it seems that the interpolation is pulling
>> ‘activity values’ into areas in the volume for which no functional estimate
>> was provided.
>> This could happen if the specification of the ‘inside’ field in the
>> source variable, prior to interpolation, behaves unpredictably.
>> Whether or not this is specific to the Matlab version used, I don’t know.
>> Also, it is unclear what version of fieldtrip you are using.
>>
>> What I can see in your script, though, is that the sourcePost_nocon you
>> use to generate the first ‘correct’ 2 figures is loaded from disk, whereas
>> the other source structure (with the ‘incorrect’ interpolation) is not.
>>
>> Best wishes,
>> Jan-Mathijs
>>
>>
>> On 25 Feb 2020, at 13:46, Zoltan Juhasz <z65.juhasz at gmail.com> wrote:
>>
>> I have recently run into a problem while executing the Beamformer
>> Fieldtrip demo at http://www.fieldtriptoolbox.org/tutorial/beamformer/
>>
>> I am using the sample data set and the source code from this page but the
>> picture I get for the section "Source Analysis: Contrast activity to
>> another interval" is rather strange. I include here the 3 outputs, first
>> two are correct, third one is the problematic one. Also included is the
>> source. Matlab version used: R2019a. Could someone check whether it is a
>> script error or perhaps a change in Matlab that generates the odd result?
>>
>> links to figures and source:
>>
>> https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
>>
>> Thanks,
>> Zoltan
>> University of Pannonia, Hungary
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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/20200304/4c45b43d/attachment.htm>

From paolo.belardinelli at gmail.com  Wed Mar  4 15:06:42 2020
From: paolo.belardinelli at gmail.com (Paolo Belardinelli)
Date: Wed, 4 Mar 2020 15:06:42 +0100
Subject: [FieldTrip] Axes mismatch switching from Fieldtrip to Freesurfer
Message-ID: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>

Dear Fieldtrippers,

still about the source pipeline using both Fieldtrip and Freesurfer:
- I load my nifti file with ft_readmri, without changing the axes
- I reslice the voxels
- I define the fiducials for sensor and acpc space definition.
- I save in mgz format
Then, if I visualize the mgz files with freeview the axes directions
appear wrong  (L-R shown in the P-A window and so on)
If I visualize the original .nii file, the projections appear correct.
The mismatch appears nor to depend on the file format (I tried to
save from FT in both mgz and nifti) neither on LPA and RPA
definition (I tried to swap the 2 points).
This has consequences on FS white matter segmentation: FS segments
correctly the .nii file but it fails when using the mgz file I
generated with FT.
Did someone experience the same issue?

Best,

Paolo


-- 
--
Paolo Belardinelli, PhD
Neurology Department
University Hospital Tuebingen
Eberhard Karls University Tuebingen
Hoppe-Seyler Str. 3
D-72076 Tuebingen
Tel: +49 7071 / 29 80478


From does.moolenaar-van-der-does19 at imperial.ac.uk  Wed Mar  4 15:54:11 2020
From: does.moolenaar-van-der-does19 at imperial.ac.uk (Moolenaar Van Der Does, Does)
Date: Wed, 4 Mar 2020 14:54:11 +0000
Subject: [FieldTrip] Help
Message-ID: <AM6PR06MB46159E10B192B1940CFEF20198E50@AM6PR06MB4615.eurprd06.prod.outlook.com>

Hi,

I am relatively new to coding and FieldTrip, so am going through the tutorials on the website. I am currently on "trigger-based trial selection". I have downloaded the correct data and added it onto my matlab pathway as well as the FieldTrip tool box (using ft_default to ensure not all of the folders are added onto the path). However, after the first bit of code:

cfg                         = [];

cfg.dataset                 = 'Subject01.ds';

cfg.trialfun                = 'ft_trialfun_general'; % this is the default

cfg.trialdef.eventtype      = 'backpanel trigger';

cfg.trialdef.eventvalue = [3 5 9]; % the values of the stimulus trigger for all three conditions

%  (3: fully incongruent (FIC), 5: initially congruent (IC), 9: fully congruent (FC))

cfg.trialdef.prestim = 1; % in secs

cfg.trialdef.poststim = 2; % in secs



cfg = ft_definetrial(cfg);


I am receiving this message:

evaluating trialfunction 'ft_trialfun_general'
reading the header from 'Subject01.ds'
Error using ft_read_header (line 2604)
unsupported header format "unknown"

Error in ft_trialfun_general (line 84)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);

Error in ft_definetrial (line 185)
    [trl, event] = feval(cfg.trialfun, cfg);

​Could someone please help me fix this problem? Have been trying to understand it myself but with no luck.Thank you!

Does Moolenaar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200304/55070895/attachment.htm>

From z65.juhasz at gmail.com  Wed Mar  4 17:52:48 2020
From: z65.juhasz at gmail.com (Zoltan Juhasz)
Date: Wed, 4 Mar 2020 17:52:48 +0100
Subject: [FieldTrip] Problem with Beamformer demo
In-Reply-To: <CANxafJnJUcDu0PfuA4i+m9=1otC=nqKPiSk=Yuj5yToZ3Y65aA@mail.gmail.com>
References: <CANxafJ=attViuffT+a22T4AB_2_MOCb5kQC1gpyGZu6CLFFExQ@mail.gmail.com>
 <894A4A40-F4DB-4891-80C2-2922BC7FC488@donders.ru.nl>
 <CANxafJnebdGw99z8SO5_CVRC1extBLuom2AEMPD=XeUjTEL24Q@mail.gmail.com>
 <1583324354031.15307@donders.ru.nl>
 <CANxafJnJUcDu0PfuA4i+m9=1otC=nqKPiSk=Yuj5yToZ3Y65aA@mail.gmail.com>
Message-ID: <CANxafJmYFkxhF-HXVjKDgc3HpugwMfdPON6-Qi0QHD7gC_EYjg@mail.gmail.com>

Sophie,
Magic. It works perfectly with the new version, and finished about 10 times
faster. Perhaps it reused data still in the Matlab workplace, but the
important thing is that it gives correct results.

Thanks again,
Zoltan

On Wed, Mar 4, 2020 at 1:48 PM Zoltan Juhasz <z65.juhasz at gmail.com> wrote:

> Dear Sophie,
> Thanks fort the update. I'll try again shortly with the latest version of
> fieldtrip. Will let you know about the outcome.
> Zoltan
>
> On Wed, 4 Mar 2020, 13:44 Arana, S.L. (Sophie), <S.Arana at donders.ru.nl>
> wrote:
>
>> ​​​Dear Zoltan,
>>
>>
>> I have indeed recently updated the beamformer tutorial. I just ran it
>> with Matlab 2019a and the most recent Fieldtrip version (available on
>> Github) and the figures look fine to me.
>>
>> Could you update your Fieldtrip version and try again?
>>
>>
>> Best,
>>
>> Sophie
>> ------------------------------
>> *From:* fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Zoltan
>> Juhasz <z65.juhasz at gmail.com>
>> *Sent:* Wednesday, March 4, 2020 11:38 AM
>> *To:* FieldTrip discussion list
>> *Subject:* Re: [FieldTrip] Problem with Beamformer demo
>>
>> Hi Jan-Mathijs,
>>
>> Thanks for getting back to me. I noticed that the documentation page has
>> changed since my first email, so I created a new script and ran this again.
>> This time no data is loaded from disk during computation, I am using what
>> is produced by the script. The result is very disappointing, all figures
>> are wrong. I have uploaded the script, the execution log and the output
>> figures. Could you please check what could be wrong here?
>>
>> The link to the files is the same as before:
>> https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
>> Matlab version: r2019a
>> Fieldtrip version: 20190121
>>
>> Thanks,
>> Zoltan
>>
>>
>> On Thu, Feb 27, 2020 at 10:00 AM Schoffelen, J.M. (Jan Mathijs) <
>> jan.schoffelen at donders.ru.nl> wrote:
>>
>>> Hi Zoltan,
>>>
>>>
>>> Have you checked the values of the numbers in the functional data prior
>>> to calling ft_sourceinterpolate? This would give an indication of whether
>>> it is an interpolation issue or not.
>>> I suspect that latter, because it seems that the interpolation is
>>> pulling ‘activity values’ into areas in the volume for which no functional
>>> estimate was provided.
>>> This could happen if the specification of the ‘inside’ field in the
>>> source variable, prior to interpolation, behaves unpredictably.
>>> Whether or not this is specific to the Matlab version used, I don’t
>>> know. Also, it is unclear what version of fieldtrip you are using.
>>>
>>> What I can see in your script, though, is that the sourcePost_nocon you
>>> use to generate the first ‘correct’ 2 figures is loaded from disk, whereas
>>> the other source structure (with the ‘incorrect’ interpolation) is not.
>>>
>>> Best wishes,
>>> Jan-Mathijs
>>>
>>>
>>> On 25 Feb 2020, at 13:46, Zoltan Juhasz <z65.juhasz at gmail.com> wrote:
>>>
>>> I have recently run into a problem while executing the Beamformer
>>> Fieldtrip demo at http://www.fieldtriptoolbox.org/tutorial/beamformer/
>>>
>>> I am using the sample data set and the source code from this page but
>>> the picture I get for the section "Source Analysis: Contrast activity to
>>> another interval" is rather strange. I include here the 3 outputs, first
>>> two are correct, third one is the problematic one. Also included is the
>>> source. Matlab version used: R2019a. Could someone check whether it is a
>>> script error or perhaps a change in Matlab that generates the odd result?
>>>
>>> links to figures and source:
>>>
>>> https://drive.google.com/drive/folders/1XPZd5l3og1WAEt8dK6Bx7a9W8xgSzCMF?usp=sharing
>>>
>>> Thanks,
>>> Zoltan
>>> University of Pannonia, Hungary
>>> _______________________________________________
>>> 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
>>>
>> _______________________________________________
>> 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/20200304/f6a26342/attachment.htm>

From az2604 at columbia.edu  Thu Mar  5 00:09:05 2020
From: az2604 at columbia.edu (Asieh Zadbood)
Date: Wed, 4 Mar 2020 18:09:05 -0500
Subject: [FieldTrip] post-op MRI in ECoG
Message-ID: <CANmsQj13FaQaVLYScF35dtjXPL4H5ZS0uYdmJG24NfNR2qyBGw@mail.gmail.com>

Hello,

I have a question about using the toolbox. Hope this is the right place to
ask it. If not, apologies for spamming.

Is it possible to use post-operation MRI instead of CT for electrode
localization in ECoG patients? I have seen some datasets that seem like
they have post-op MRI not CT, if I'm not wrong. In that case, can fieldtrip
be used for electrode localization? If not, is there any other toolbox or
software that you recommend for this.

Thank you very much in advance.
Regards,
Asieh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200304/4c4ac74b/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Mar  5 07:46:17 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 5 Mar 2020 06:46:17 +0000
Subject: [FieldTrip] Help
In-Reply-To: <AM6PR06MB46159E10B192B1940CFEF20198E50@AM6PR06MB4615.eurprd06.prod.outlook.com>
References: <AM6PR06MB46159E10B192B1940CFEF20198E50@AM6PR06MB4615.eurprd06.prod.outlook.com>
Message-ID: <BC19644D-7D9B-4ABB-9015-C74D9E088EB6@donders.ru.nl>

Dear Does,

This error looks as if the dataset cannot be found. You either need to call ft_definetrial from within the directory that ’sees’ Subject01.ds, or use a full path to the file, e.g. /data/somefolder/somotherolder/yetanotherfolder/Subject01.ds’

Best wishes,
Jan-Mathijs

On 4 Mar 2020, at 15:54, Moolenaar Van Der Does, Does <does.moolenaar-van-der-does19 at imperial.ac.uk<mailto:does.moolenaar-van-der-does19 at imperial.ac.uk>> wrote:

Hi,

I am relatively new to coding and FieldTrip, so am going through the tutorials on the website. I am currently on "trigger-based trial selection". I have downloaded the correct data and added it onto my matlab pathway as well as the FieldTrip tool box (using ft_default to ensure not all of the folders are added onto the path). However, after the first bit of code:
cfg                         = [];
cfg.dataset                 = 'Subject01.ds';
cfg.trialfun                = 'ft_trialfun_general'; % this is the default
cfg.trialdef.eventtype      = 'backpanel trigger';
cfg.trialdef.eventvalue = [3 5 9]; % the values of the stimulus trigger for all three conditions
%  (3: fully incongruent (FIC), 5: initially congruent (IC), 9: fully congruent (FC))
cfg.trialdef.prestim = 1; % in secs
cfg.trialdef.poststim = 2; % in secs



cfg = ft_definetrial(cfg);


I am receiving this message:

evaluating trialfunction 'ft_trialfun_general'
reading the header from 'Subject01.ds'
Error using ft_read_header (line 2604)
unsupported header format "unknown"

Error in ft_trialfun_general (line 84)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);

Error in ft_definetrial (line 185)
    [trl, event] = feval(cfg.trialfun, cfg);

​Could someone please help me fix this problem? Have been trying to understand it myself but with no luck.Thank you!

Does Moolenaar
_______________________________________________
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/20200305/c4fba822/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Mar  5 08:12:48 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 5 Mar 2020 07:12:48 +0000
Subject: [FieldTrip] Axes mismatch switching from Fieldtrip to Freesurfer
In-Reply-To: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>
References: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>
Message-ID: <C4DF63C8-B523-4FEC-B860-D47DF34DBDDC@donders.ru.nl>

Hi Paolo,

I would check:

1) whether the coordinate system in the aligned MR images is correct. Don’t use freeview, but do this with ft_determine_coordsys, and check whether the x/y/z axes are pointing into the expected direction
2) what information freeview uses to ‘guess’ the a/p etc. directions. If this is anything else than the primary transformation matrix in the file (e.g. if it uses some magic variable such as slice order or so) then this might cause your reported discrepancy.
3) (again) check whether the first step into the freesurfer pipeline script, i.e. the call to mri_convert is yielding the expected results. It is well known that freesurfer is very picky about the FOV and the orientation of the voxel space.

Best wishes,
Jan-Mathijs


> On 4 Mar 2020, at 15:06, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
> 
> Dear Fieldtrippers,
> 
> still about the source pipeline using both Fieldtrip and Freesurfer:
> - I load my nifti file with ft_readmri, without changing the axes
> - I reslice the voxels
> - I define the fiducials for sensor and acpc space definition.
> - I save in mgz format
> Then, if I visualize the mgz files with freeview the axes directions
> appear wrong  (L-R shown in the P-A window and so on)
> If I visualize the original .nii file, the projections appear correct.
> The mismatch appears nor to depend on the file format (I tried to
> save from FT in both mgz and nifti) neither on LPA and RPA
> definition (I tried to swap the 2 points).
> This has consequences on FS white matter segmentation: FS segments
> correctly the .nii file but it fails when using the mgz file I
> generated with FT.
> Did someone experience the same issue?
> 
> Best,
> 
> Paolo
> 
> 
> -- 
> --
> Paolo Belardinelli, PhD
> Neurology Department
> University Hospital Tuebingen
> Eberhard Karls University Tuebingen
> Hoppe-Seyler Str. 3
> D-72076 Tuebingen
> Tel: +49 7071 / 29 80478
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202




From paolo.belardinelli at gmail.com  Thu Mar  5 10:48:44 2020
From: paolo.belardinelli at gmail.com (Paolo Belardinelli)
Date: Thu, 5 Mar 2020 10:48:44 +0100
Subject: [FieldTrip] Axes mismatch switching from Fieldtrip to Freesurfer
In-Reply-To: <C4DF63C8-B523-4FEC-B860-D47DF34DBDDC@donders.ru.nl>
References: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>
 <C4DF63C8-B523-4FEC-B860-D47DF34DBDDC@donders.ru.nl>
Message-ID: <CAMa54+OucQ_Lbh6QefqF6-fJX1rTfAOvbLL2yHJNOP_OfBC=Gg@mail.gmail.com>

Dear Jan-Mathijs,

in the meantime, I discovering the following:
1. The mismatch was due to the absence of my declaration of
cfg.coordsys before ft_volumerealign. Despite the nifti file being in
RAS, ft_volumerealign imposed an ALS coordinate system to the image.
This was conflicting with some other information coming from the nifti
file that freesurfer uses.
     The previous call to ft_determine_coordinate_system did not
assign the mri.coordsys field.
2. After correctly loading the image (Fig. Before) I am now declaring
cfg.coordsys = 'neuromag' before calling ft_volumerealign. This makes
the axes right but imposes a rotation of the head towards the inferior
side of the figure of about 30° (Fig. After: I guess the horizontal
plane is forced to be constituted by the plane which pass through LPA,
RPA and Nasion).
Is there a simple fix to this?

Best wishes,

Paolo

On Thu, Mar 5, 2020 at 8:15 AM Schoffelen, J.M. (Jan Mathijs)
<jan.schoffelen at donders.ru.nl> wrote:
>
> Hi Paolo,
>
> I would check:
>
> 1) whether the coordinate system in the aligned MR images is correct. Don’t use freeview, but do this with ft_determine_coordsys, and check whether the x/y/z axes are pointing into the expected direction
> 2) what information freeview uses to ‘guess’ the a/p etc. directions. If this is anything else than the primary transformation matrix in the file (e.g. if it uses some magic variable such as slice order or so) then this might cause your reported discrepancy.
> 3) (again) check whether the first step into the freesurfer pipeline script, i.e. the call to mri_convert is yielding the expected results. It is well known that freesurfer is very picky about the FOV and the orientation of the voxel space.
>
> Best wishes,
> Jan-Mathijs
>
>
> > On 4 Mar 2020, at 15:06, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
> >
> > Dear Fieldtrippers,
> >
> > still about the source pipeline using both Fieldtrip and Freesurfer:
> > - I load my nifti file with ft_readmri, without changing the axes
> > - I reslice the voxels
> > - I define the fiducials for sensor and acpc space definition.
> > - I save in mgz format
> > Then, if I visualize the mgz files with freeview the axes directions
> > appear wrong  (L-R shown in the P-A window and so on)
> > If I visualize the original .nii file, the projections appear correct.
> > The mismatch appears nor to depend on the file format (I tried to
> > save from FT in both mgz and nifti) neither on LPA and RPA
> > definition (I tried to swap the 2 points).
> > This has consequences on FS white matter segmentation: FS segments
> > correctly the .nii file but it fails when using the mgz file I
> > generated with FT.
> > Did someone experience the same issue?
> >
> > Best,
> >
> > Paolo
> >
> >
> > --
> > --
> > Paolo Belardinelli, PhD
> > Neurology Department
> > University Hospital Tuebingen
> > Eberhard Karls University Tuebingen
> > Hoppe-Seyler Str. 3
> > D-72076 Tuebingen
> > Tel: +49 7071 / 29 80478
> > _______________________________________________
> > 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



--
--
Paolo Belardinelli, PhD
Neurology Department
University Hospital Tuebingen
Eberhard Karls University Tuebingen
Hoppe-Seyler Str. 3
D-72076 Tuebingen
Tel: +49 7071 / 29 80478
-------------- next part --------------
A non-text attachment was scrubbed...
Name: After.jpg
Type: image/jpeg
Size: 264346 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200305/26e40967/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Before.jpg
Type: image/jpeg
Size: 301929 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200305/26e40967/attachment-0001.jpg>

From jan.schoffelen at donders.ru.nl  Thu Mar  5 11:12:41 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 5 Mar 2020 10:12:41 +0000
Subject: [FieldTrip] Axes mismatch switching from Fieldtrip to Freesurfer
In-Reply-To: <CAMa54+OucQ_Lbh6QefqF6-fJX1rTfAOvbLL2yHJNOP_OfBC=Gg@mail.gmail.com>
References: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>
 <C4DF63C8-B523-4FEC-B860-D47DF34DBDDC@donders.ru.nl>
 <CAMa54+OucQ_Lbh6QefqF6-fJX1rTfAOvbLL2yHJNOP_OfBC=Gg@mail.gmail.com>
Message-ID: <D11DB00C-7841-41D9-8EA3-9EA7A10D55AB@donders.ru.nl>

Dear Paolo,

Perhaps I don’t understand you, but the ‘fix’ would be to realign the image to ‘acpc’, or ‘ras’ in ft_volumerealign.

Just to reiterate what the whole rationale of the pipeline is:

Start from an anatomical image.
Use ft_volumerealign (twice) on this image to define 2 coordinate systems: 
1) for the MEG-system based coordinate system (’neuromag’ ‘ctf’ ‘itab’ ‘whatever-convention-is-used’), cfg.coordsys = ’neuromag/ctf/somethingelse’, and the clicking needs to be done on LPA,RPA,NAS
2) for an acpc-based RAS coordinate system, that is required by the anatomical processing freesurfer pipeline, cfg.coordsys = ‘acpc’ (or so), and clicking needs to be done on ac, pc, zpoint

Once you have 2 (non-resliced) MRI images that have 2 different transformation matrices, you at least can go from one coordinate system to the other by defining the transformation as mri1.transform/mri2.transform (or the other way around, depending on which direction you want to transform). 

Now, provided that Freesurfer manages to spit out its results in the acpc based coordinate system as defined in step 2) above, the preconditions are met to map the freesurfer results (provided they make sense) to the MEG based coordinate system.

The thing that next needs to be ensured, is that the input volume into the freesurfer pipeline makes sense in terms of the FOV and voxel orientation etc. This is achieved with mri_convert. The input into this command should be a ACPC-RAS registered volume, in combination with some magic input arguments (I believe -c and -oc ring a bell).

Note that ft_volumerealign does not do any reslicing, and that ft_determine_coordsys just visualises the 3 orthogonal slices, as per the information in the transformation matrix, and does not care about the definition of the coordinate system.

JM



> On 5 Mar 2020, at 10:48, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
> 
> Dear Jan-Mathijs,
> 
> in the meantime, I discovering the following:
> 1. The mismatch was due to the absence of my declaration of
> cfg.coordsys before ft_volumerealign. Despite the nifti file being in
> RAS, ft_volumerealign imposed an ALS coordinate system to the image.
> This was conflicting with some other information coming from the nifti
> file that freesurfer uses.
>     The previous call to ft_determine_coordinate_system did not
> assign the mri.coordsys field.
> 2. After correctly loading the image (Fig. Before) I am now declaring
> cfg.coordsys = 'neuromag' before calling ft_volumerealign. This makes
> the axes right but imposes a rotation of the head towards the inferior
> side of the figure of about 30° (Fig. After: I guess the horizontal
> plane is forced to be constituted by the plane which pass through LPA,
> RPA and Nasion).
> Is there a simple fix to this?
> 
> Best wishes,
> 
> Paolo
> 
> On Thu, Mar 5, 2020 at 8:15 AM Schoffelen, J.M. (Jan Mathijs)
> <jan.schoffelen at donders.ru.nl> wrote:
>> 
>> Hi Paolo,
>> 
>> I would check:
>> 
>> 1) whether the coordinate system in the aligned MR images is correct. Don’t use freeview, but do this with ft_determine_coordsys, and check whether the x/y/z axes are pointing into the expected direction
>> 2) what information freeview uses to ‘guess’ the a/p etc. directions. If this is anything else than the primary transformation matrix in the file (e.g. if it uses some magic variable such as slice order or so) then this might cause your reported discrepancy.
>> 3) (again) check whether the first step into the freesurfer pipeline script, i.e. the call to mri_convert is yielding the expected results. It is well known that freesurfer is very picky about the FOV and the orientation of the voxel space.
>> 
>> Best wishes,
>> Jan-Mathijs
>> 
>> 
>>> On 4 Mar 2020, at 15:06, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
>>> 
>>> Dear Fieldtrippers,
>>> 
>>> still about the source pipeline using both Fieldtrip and Freesurfer:
>>> - I load my nifti file with ft_readmri, without changing the axes
>>> - I reslice the voxels
>>> - I define the fiducials for sensor and acpc space definition.
>>> - I save in mgz format
>>> Then, if I visualize the mgz files with freeview the axes directions
>>> appear wrong  (L-R shown in the P-A window and so on)
>>> If I visualize the original .nii file, the projections appear correct.
>>> The mismatch appears nor to depend on the file format (I tried to
>>> save from FT in both mgz and nifti) neither on LPA and RPA
>>> definition (I tried to swap the 2 points).
>>> This has consequences on FS white matter segmentation: FS segments
>>> correctly the .nii file but it fails when using the mgz file I
>>> generated with FT.
>>> Did someone experience the same issue?
>>> 
>>> Best,
>>> 
>>> Paolo
>>> 
>>> 
>>> --
>>> --
>>> Paolo Belardinelli, PhD
>>> Neurology Department
>>> University Hospital Tuebingen
>>> Eberhard Karls University Tuebingen
>>> Hoppe-Seyler Str. 3
>>> D-72076 Tuebingen
>>> Tel: +49 7071 / 29 80478
>>> _______________________________________________
>>> 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
> 
> 
> 
> --
> --
> Paolo Belardinelli, PhD
> Neurology Department
> University Hospital Tuebingen
> Eberhard Karls University Tuebingen
> Hoppe-Seyler Str. 3
> D-72076 Tuebingen
> Tel: +49 7071 / 29 80478
> <After.jpg><Before.jpg>_______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202




From a.stolk8 at gmail.com  Thu Mar  5 12:02:51 2020
From: a.stolk8 at gmail.com (Arjen Stolk)
Date: Thu, 5 Mar 2020 11:02:51 +0000
Subject: [FieldTrip] post-op MRI in ECoG
In-Reply-To: <CANmsQj13FaQaVLYScF35dtjXPL4H5ZS0uYdmJG24NfNR2qyBGw@mail.gmail.com>
References: <CANmsQj13FaQaVLYScF35dtjXPL4H5ZS0uYdmJG24NfNR2qyBGw@mail.gmail.com>
Message-ID: <D559657E-AD55-47DB-B820-33AF43FC38CA@gmail.com>

Hi Asieh,

The short answer would be yes, as long as you can see the electrodes (voids) in the post-op MR. From the top of my head, you’ll have to specify cfg.magtype = ‘trough’ at step 17 of the iEEG tutorial (http://www.fieldtriptoolbox.org/tutorial/human_ecog). The article linked to this tutorial contains further recommendations for going this route. 

Best,
Arjen

> On Mar 4, 2020, at 11:09 PM, Asieh Zadbood <az2604 at columbia.edu> wrote:
> 
> Hello,
> 
> I have a question about using the toolbox. Hope this is the right place to ask it. If not, apologies for spamming.
> 
> Is it possible to use post-operation MRI instead of CT for electrode localization in ECoG patients? I have seen some datasets that seem like they have post-op MRI not CT, if I'm not wrong. In that case, can fieldtrip be used for electrode localization? If not, is there any other toolbox or software that you recommend for this.
> 
> Thank you very much in advance.
> Regards,
> Asieh
> _______________________________________________
> 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/20200305/ac30a574/attachment.htm>

From paolo.belardinelli at gmail.com  Thu Mar  5 14:20:31 2020
From: paolo.belardinelli at gmail.com (Paolo Belardinelli)
Date: Thu, 5 Mar 2020 14:20:31 +0100
Subject: [FieldTrip] Axes mismatch switching from Fieldtrip to Freesurfer
In-Reply-To: <D11DB00C-7841-41D9-8EA3-9EA7A10D55AB@donders.ru.nl>
References: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>
 <C4DF63C8-B523-4FEC-B860-D47DF34DBDDC@donders.ru.nl>
 <CAMa54+OucQ_Lbh6QefqF6-fJX1rTfAOvbLL2yHJNOP_OfBC=Gg@mail.gmail.com>
 <D11DB00C-7841-41D9-8EA3-9EA7A10D55AB@donders.ru.nl>
Message-ID: <CAMa54+MRhqVb9EkVfdZ7=wLnd+vg8+Fs5kVuwdQFYh_LXkFLYw@mail.gmail.com>

Dear Jan-Mathijs,

the points describing the pipeline rationale are clear (and precious) to me.
What I am currently missing is the way to avoid the small rotation
shown in the previous email while defining my sensor-based volume
through the LPA RPA NASION fiducials on my nifti file.
Declaring cfg.coordsys='neuromag' implies the rotation depicted in the
images from my previous email. I want to avoid this but both
'neuromag' and 'itab' provide for a similar rotation.

My mri.transform matrix before ft_volume_realign (which I would like
to preserve but if I don't explicitly declare cfg.coordsys, this gets
changed into an ALS system, after setting the fiducials), after
ft_read_mri:
0.7997   -0.0111    0.0198  -78.7187
0.0086    0.7936    0.1008 -110.5234
-0.0211   -0.1005    0.7934 -126.3713
         0         0         0             1.0000

My mri.transform after ft_volume_realign with coordsys RAS 'neuromag':
0.8000    0.0000   -0.0000  -82.3998
-0.0000    0.7531    0.2700 -145.6980
         0   -0.2700    0.7531  -65.0483
         0         0         0              1.0000

My mri.transform after ft_volume_realign with coordsys RAS 'itab':
 0.7989    0.0413   -0.0046  -92.6101
   -0.0377    0.7578    0.2535 -140.4391
    0.0174   -0.2529    0.7588  -72.1264
         0         0             0            1.0000

The small rotation still appears to affect Freesurfer segmentation performance.
Maybe I am missing something basic, here.

Best,

Paolo



On Thu, Mar 5, 2020 at 11:15 AM Schoffelen, J.M. (Jan Mathijs)
<jan.schoffelen at donders.ru.nl> wrote:
>
> Dear Paolo,
>
> Perhaps I don’t understand you, but the ‘fix’ would be to realign the image to ‘acpc’, or ‘ras’ in ft_volumerealign.
>
> Just to reiterate what the whole rationale of the pipeline is:
>
> Start from an anatomical image.
> Use ft_volumerealign (twice) on this image to define 2 coordinate systems:
> 1) for the MEG-system based coordinate system (’neuromag’ ‘ctf’ ‘itab’ ‘whatever-convention-is-used’), cfg.coordsys = ’neuromag/ctf/somethingelse’, and the clicking needs to be done on LPA,RPA,NAS
> 2) for an acpc-based RAS coordinate system, that is required by the anatomical processing freesurfer pipeline, cfg.coordsys = ‘acpc’ (or so), and clicking needs to be done on ac, pc, zpoint
>
> Once you have 2 (non-resliced) MRI images that have 2 different transformation matrices, you at least can go from one coordinate system to the other by defining the transformation as mri1.transform/mri2.transform (or the other way around, depending on which direction you want to transform).
>
> Now, provided that Freesurfer manages to spit out its results in the acpc based coordinate system as defined in step 2) above, the preconditions are met to map the freesurfer results (provided they make sense) to the MEG based coordinate system.
>
> The thing that next needs to be ensured, is that the input volume into the freesurfer pipeline makes sense in terms of the FOV and voxel orientation etc. This is achieved with mri_convert. The input into this command should be a ACPC-RAS registered volume, in combination with some magic input arguments (I believe -c and -oc ring a bell).
>
> Note that ft_volumerealign does not do any reslicing, and that ft_determine_coordsys just visualises the 3 orthogonal slices, as per the information in the transformation matrix, and does not care about the definition of the coordinate system.
>
> JM
>
>
>
> > On 5 Mar 2020, at 10:48, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
> >
> > Dear Jan-Mathijs,
> >
> > in the meantime, I discovering the following:
> > 1. The mismatch was due to the absence of my declaration of
> > cfg.coordsys before ft_volumerealign. Despite the nifti file being in
> > RAS, ft_volumerealign imposed an ALS coordinate system to the image.
> > This was conflicting with some other information coming from the nifti
> > file that freesurfer uses.
> >     The previous call to ft_determine_coordinate_system did not
> > assign the mri.coordsys field.
> > 2. After correctly loading the image (Fig. Before) I am now declaring
> > cfg.coordsys = 'neuromag' before calling ft_volumerealign. This makes
> > the axes right but imposes a rotation of the head towards the inferior
> > side of the figure of about 30° (Fig. After: I guess the horizontal
> > plane is forced to be constituted by the plane which pass through LPA,
> > RPA and Nasion).
> > Is there a simple fix to this?
> >
> > Best wishes,
> >
> > Paolo
> >
> > On Thu, Mar 5, 2020 at 8:15 AM Schoffelen, J.M. (Jan Mathijs)
> > <jan.schoffelen at donders.ru.nl> wrote:
> >>
> >> Hi Paolo,
> >>
> >> I would check:
> >>
> >> 1) whether the coordinate system in the aligned MR images is correct. Don’t use freeview, but do this with ft_determine_coordsys, and check whether the x/y/z axes are pointing into the expected direction
> >> 2) what information freeview uses to ‘guess’ the a/p etc. directions. If this is anything else than the primary transformation matrix in the file (e.g. if it uses some magic variable such as slice order or so) then this might cause your reported discrepancy.
> >> 3) (again) check whether the first step into the freesurfer pipeline script, i.e. the call to mri_convert is yielding the expected results. It is well known that freesurfer is very picky about the FOV and the orientation of the voxel space.
> >>
> >> Best wishes,
> >> Jan-Mathijs
> >>
> >>
> >>> On 4 Mar 2020, at 15:06, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
> >>>
> >>> Dear Fieldtrippers,
> >>>
> >>> still about the source pipeline using both Fieldtrip and Freesurfer:
> >>> - I load my nifti file with ft_readmri, without changing the axes
> >>> - I reslice the voxels
> >>> - I define the fiducials for sensor and acpc space definition.
> >>> - I save in mgz format
> >>> Then, if I visualize the mgz files with freeview the axes directions
> >>> appear wrong  (L-R shown in the P-A window and so on)
> >>> If I visualize the original .nii file, the projections appear correct.
> >>> The mismatch appears nor to depend on the file format (I tried to
> >>> save from FT in both mgz and nifti) neither on LPA and RPA
> >>> definition (I tried to swap the 2 points).
> >>> This has consequences on FS white matter segmentation: FS segments
> >>> correctly the .nii file but it fails when using the mgz file I
> >>> generated with FT.
> >>> Did someone experience the same issue?
> >>>
> >>> Best,
> >>>
> >>> Paolo
> >>>
> >>>
> >>> --
> >>> --
> >>> Paolo Belardinelli, PhD
> >>> Neurology Department
> >>> University Hospital Tuebingen
> >>> Eberhard Karls University Tuebingen
> >>> Hoppe-Seyler Str. 3
> >>> D-72076 Tuebingen
> >>> Tel: +49 7071 / 29 80478
> >>> _______________________________________________
> >>> 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
> >
> >
> >
> > --
> > --
> > Paolo Belardinelli, PhD
> > Neurology Department
> > University Hospital Tuebingen
> > Eberhard Karls University Tuebingen
> > Hoppe-Seyler Str. 3
> > D-72076 Tuebingen
> > Tel: +49 7071 / 29 80478
> > <After.jpg><Before.jpg>_______________________________________________
> > 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



--
--
Paolo Belardinelli, PhD
Neurology Department
University Hospital Tuebingen
Eberhard Karls University Tuebingen
Hoppe-Seyler Str. 3
D-72076 Tuebingen
Tel: +49 7071 / 29 80478



From jan.schoffelen at donders.ru.nl  Thu Mar  5 14:57:04 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 5 Mar 2020 13:57:04 +0000
Subject: [FieldTrip] Axes mismatch switching from Fieldtrip to Freesurfer
In-Reply-To: <CAMa54+MRhqVb9EkVfdZ7=wLnd+vg8+Fs5kVuwdQFYh_LXkFLYw@mail.gmail.com>
References: <CAMa54+N5_TRqcT0V-okhkUPmgAvkNAQcG48_RiKz5NrmJD0d3Q@mail.gmail.com>
 <C4DF63C8-B523-4FEC-B860-D47DF34DBDDC@donders.ru.nl>
 <CAMa54+OucQ_Lbh6QefqF6-fJX1rTfAOvbLL2yHJNOP_OfBC=Gg@mail.gmail.com>
 <D11DB00C-7841-41D9-8EA3-9EA7A10D55AB@donders.ru.nl>
 <CAMa54+MRhqVb9EkVfdZ7=wLnd+vg8+Fs5kVuwdQFYh_LXkFLYw@mail.gmail.com>
Message-ID: <37EDBD66-EE3B-4A7C-9BDD-CCF3E3E331D4@donders.ru.nl>

Hi Paolo,

The input into the freesurfer pipeline should be a ‘acpc’ registered volume.

JM


> On 5 Mar 2020, at 14:20, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
> 
> Dear Jan-Mathijs,
> 
> the points describing the pipeline rationale are clear (and precious) to me.
> What I am currently missing is the way to avoid the small rotation
> shown in the previous email while defining my sensor-based volume
> through the LPA RPA NASION fiducials on my nifti file.
> Declaring cfg.coordsys='neuromag' implies the rotation depicted in the
> images from my previous email. I want to avoid this but both
> 'neuromag' and 'itab' provide for a similar rotation.
> 
> My mri.transform matrix before ft_volume_realign (which I would like
> to preserve but if I don't explicitly declare cfg.coordsys, this gets
> changed into an ALS system, after setting the fiducials), after
> ft_read_mri:
> 0.7997   -0.0111    0.0198  -78.7187
> 0.0086    0.7936    0.1008 -110.5234
> -0.0211   -0.1005    0.7934 -126.3713
>         0         0         0             1.0000
> 
> My mri.transform after ft_volume_realign with coordsys RAS 'neuromag':
> 0.8000    0.0000   -0.0000  -82.3998
> -0.0000    0.7531    0.2700 -145.6980
>         0   -0.2700    0.7531  -65.0483
>         0         0         0              1.0000
> 
> My mri.transform after ft_volume_realign with coordsys RAS 'itab':
> 0.7989    0.0413   -0.0046  -92.6101
>   -0.0377    0.7578    0.2535 -140.4391
>    0.0174   -0.2529    0.7588  -72.1264
>         0         0             0            1.0000
> 
> The small rotation still appears to affect Freesurfer segmentation performance.
> Maybe I am missing something basic, here.
> 
> Best,
> 
> Paolo
> 
> 
> 
> On Thu, Mar 5, 2020 at 11:15 AM Schoffelen, J.M. (Jan Mathijs)
> <jan.schoffelen at donders.ru.nl> wrote:
>> 
>> Dear Paolo,
>> 
>> Perhaps I don’t understand you, but the ‘fix’ would be to realign the image to ‘acpc’, or ‘ras’ in ft_volumerealign.
>> 
>> Just to reiterate what the whole rationale of the pipeline is:
>> 
>> Start from an anatomical image.
>> Use ft_volumerealign (twice) on this image to define 2 coordinate systems:
>> 1) for the MEG-system based coordinate system (’neuromag’ ‘ctf’ ‘itab’ ‘whatever-convention-is-used’), cfg.coordsys = ’neuromag/ctf/somethingelse’, and the clicking needs to be done on LPA,RPA,NAS
>> 2) for an acpc-based RAS coordinate system, that is required by the anatomical processing freesurfer pipeline, cfg.coordsys = ‘acpc’ (or so), and clicking needs to be done on ac, pc, zpoint
>> 
>> Once you have 2 (non-resliced) MRI images that have 2 different transformation matrices, you at least can go from one coordinate system to the other by defining the transformation as mri1.transform/mri2.transform (or the other way around, depending on which direction you want to transform).
>> 
>> Now, provided that Freesurfer manages to spit out its results in the acpc based coordinate system as defined in step 2) above, the preconditions are met to map the freesurfer results (provided they make sense) to the MEG based coordinate system.
>> 
>> The thing that next needs to be ensured, is that the input volume into the freesurfer pipeline makes sense in terms of the FOV and voxel orientation etc. This is achieved with mri_convert. The input into this command should be a ACPC-RAS registered volume, in combination with some magic input arguments (I believe -c and -oc ring a bell).
>> 
>> Note that ft_volumerealign does not do any reslicing, and that ft_determine_coordsys just visualises the 3 orthogonal slices, as per the information in the transformation matrix, and does not care about the definition of the coordinate system.
>> 
>> JM
>> 
>> 
>> 
>>> On 5 Mar 2020, at 10:48, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
>>> 
>>> Dear Jan-Mathijs,
>>> 
>>> in the meantime, I discovering the following:
>>> 1. The mismatch was due to the absence of my declaration of
>>> cfg.coordsys before ft_volumerealign. Despite the nifti file being in
>>> RAS, ft_volumerealign imposed an ALS coordinate system to the image.
>>> This was conflicting with some other information coming from the nifti
>>> file that freesurfer uses.
>>>    The previous call to ft_determine_coordinate_system did not
>>> assign the mri.coordsys field.
>>> 2. After correctly loading the image (Fig. Before) I am now declaring
>>> cfg.coordsys = 'neuromag' before calling ft_volumerealign. This makes
>>> the axes right but imposes a rotation of the head towards the inferior
>>> side of the figure of about 30° (Fig. After: I guess the horizontal
>>> plane is forced to be constituted by the plane which pass through LPA,
>>> RPA and Nasion).
>>> Is there a simple fix to this?
>>> 
>>> Best wishes,
>>> 
>>> Paolo
>>> 
>>> On Thu, Mar 5, 2020 at 8:15 AM Schoffelen, J.M. (Jan Mathijs)
>>> <jan.schoffelen at donders.ru.nl> wrote:
>>>> 
>>>> Hi Paolo,
>>>> 
>>>> I would check:
>>>> 
>>>> 1) whether the coordinate system in the aligned MR images is correct. Don’t use freeview, but do this with ft_determine_coordsys, and check whether the x/y/z axes are pointing into the expected direction
>>>> 2) what information freeview uses to ‘guess’ the a/p etc. directions. If this is anything else than the primary transformation matrix in the file (e.g. if it uses some magic variable such as slice order or so) then this might cause your reported discrepancy.
>>>> 3) (again) check whether the first step into the freesurfer pipeline script, i.e. the call to mri_convert is yielding the expected results. It is well known that freesurfer is very picky about the FOV and the orientation of the voxel space.
>>>> 
>>>> Best wishes,
>>>> Jan-Mathijs
>>>> 
>>>> 
>>>>> On 4 Mar 2020, at 15:06, Paolo Belardinelli <paolo.belardinelli at gmail.com> wrote:
>>>>> 
>>>>> Dear Fieldtrippers,
>>>>> 
>>>>> still about the source pipeline using both Fieldtrip and Freesurfer:
>>>>> - I load my nifti file with ft_readmri, without changing the axes
>>>>> - I reslice the voxels
>>>>> - I define the fiducials for sensor and acpc space definition.
>>>>> - I save in mgz format
>>>>> Then, if I visualize the mgz files with freeview the axes directions
>>>>> appear wrong  (L-R shown in the P-A window and so on)
>>>>> If I visualize the original .nii file, the projections appear correct.
>>>>> The mismatch appears nor to depend on the file format (I tried to
>>>>> save from FT in both mgz and nifti) neither on LPA and RPA
>>>>> definition (I tried to swap the 2 points).
>>>>> This has consequences on FS white matter segmentation: FS segments
>>>>> correctly the .nii file but it fails when using the mgz file I
>>>>> generated with FT.
>>>>> Did someone experience the same issue?
>>>>> 
>>>>> Best,
>>>>> 
>>>>> Paolo
>>>>> 
>>>>> 
>>>>> --
>>>>> --
>>>>> Paolo Belardinelli, PhD
>>>>> Neurology Department
>>>>> University Hospital Tuebingen
>>>>> Eberhard Karls University Tuebingen
>>>>> Hoppe-Seyler Str. 3
>>>>> D-72076 Tuebingen
>>>>> Tel: +49 7071 / 29 80478
>>>>> _______________________________________________
>>>>> 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
>>> 
>>> 
>>> 
>>> --
>>> --
>>> Paolo Belardinelli, PhD
>>> Neurology Department
>>> University Hospital Tuebingen
>>> Eberhard Karls University Tuebingen
>>> Hoppe-Seyler Str. 3
>>> D-72076 Tuebingen
>>> Tel: +49 7071 / 29 80478
>>> <After.jpg><Before.jpg>_______________________________________________
>>> 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
> 
> 
> 
> --
> --
> Paolo Belardinelli, PhD
> Neurology Department
> University Hospital Tuebingen
> Eberhard Karls University Tuebingen
> Hoppe-Seyler Str. 3
> D-72076 Tuebingen
> Tel: +49 7071 / 29 80478
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202




From Thomas.Baumgarten at nyulangone.org  Thu Mar  5 16:26:09 2020
From: Thomas.Baumgarten at nyulangone.org (Baumgarten, Thomas)
Date: Thu, 5 Mar 2020 15:26:09 +0000
Subject: [FieldTrip] Lab manager position in Perception & Brain Dynamics
 Laboratory at NYU Medical Center
Message-ID: <4228db806ec44033a6c98e0666b473c8@nyulangone.org>

Dear Fieldtrip community,

The Perception & Brain Dynamics Laboratory (http://www.med.nyu.edu/helab/) at New York University School of Medicine is looking for a lab manager to start in spring/summer 2020.
The Laboratory is within the Neuroscience Institute at NYU Langone Health (http://www.med.nyu.edu/neuroscience), affiliated with Departments of Neurology, Neuroscience and Physiology, and Radiology. Our research focus is on understanding the neural bases of perceptual awareness using multimodal imaging (fMRI, MEG, EEG, ECoG) and stimulation (tDCS, TMS) techniques in humans, combined with computational neuroscience approaches.

We are looking for a bright and driven candidate with a Bachelor’s or Master’s degree who is dedicated to neuroscience research. A variety of backgrounds, including neuroscience, biology, psychology, and computer science is possible, and experience with programming is highly desirable. In addition, the ideal candidate has high responsibility and dependability, as well as excellent critical thinking, organizational and leadership skills. Performing independent research is an important aspect of the position, in addition to lab management duties. A minimal commitment of 2 years is required. Interested candidates please send a cover letter, a CV, undergraduate and/or graduate transcript, and names and contacts of two to three referees, to Prof. Biyu J. He at biyu.jade.he at gmail.com, with the subject line “Lab manager application 2020”. The application is rolling, so please submit your materials as soon as possible.

Best regards,
Thomas


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

Thomas J. Baumgarten, Ph.D.

Postdoctoral Researcher

Perception and Brain Dynamics Laboratory

Neuroscience Institute

New York University Langone Medical Center

New York, NY 10016

Phone: 212-263-0307

Email: Thomas.Baumgarten at nyumc.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200305/19be2d61/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Open Lab manager position - Perception & Brain Dynamics Lab @NYU.pdf
Type: application/pdf
Size: 49178 bytes
Desc: Open Lab manager position - Perception & Brain Dynamics Lab @NYU.pdf
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200305/19be2d61/attachment.pdf>

From Joachim.Lange at med.uni-duesseldorf.de  Fri Mar  6 08:28:19 2020
From: Joachim.Lange at med.uni-duesseldorf.de (Joachim.Lange at med.uni-duesseldorf.de)
Date: Fri, 6 Mar 2020 07:28:19 +0000
Subject: [FieldTrip] positions of Neuromag sensors rotated
Message-ID: <0ffbdc2ea38d4bb1b4f221b904bd1b11@med.uni-duesseldorf.de>

Hi Jan-Mathijs,
Just a brief update: I got feedback from other researchers who experienced similar problems. In their case the problem was that the reference point of the polhemus system (which is fixed at "glasses") had moved somehow during the measurement resulting in a rotated coordinate system. Have to check whether this is really the problem for me as well, but given the very similar problems it's pretty likely. That would mean that there is actually no solution for the problem ...
 Thanks for your help anyway,
Jo

Date: Fri, 28 Feb 2020 09:18:32 +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] positions of Neuromag sensors rotated
Message-ID: <91D47250-8461-48E9-A60A-02E2E5F3C93B at donders.ru.nl>
Content-Type: text/plain; charset="utf-8"

Hi Jo,
Is there another way in which you can check the  coregistration information in the fif-file? E.g. in the Elekta,  apologies, Megin software? If I recall well, but I am no expert here, there may be various coordinate systems defined in the fif-files, and it could be that something went wrong there.

Best wishes,
JM


On 28 Feb 2020, at 09:41, joachim.lange at med.uni-duesseldorf.de<mailto:joachim.lange at med.uni-duesseldorf.de> wrote:

Dear JM ;)
Thanks for your reply and the suggestions. I had done the plotting you suggested and it's the MEG sensors of the problematic subject that are off. I also had a second look at the landmarks (and the other polhemus recordings in the "headshape" variable) but couldn't find anything suspicious.
Best,
Jo


Date: Thu, 27 Feb 2020 08:58:27 +0000
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>>
Subject: Re: [FieldTrip] positions of Neuromag sensors rotated
Message-ID: <65A8AC04-6811-404A-B470-96893F76D805 at donders.ru.nl<mailto:65A8AC04-6811-404A-B470-96893F76D805 at donders.ru.nl>>
Content-Type: text/plain; charset="utf-8"

Dear Jo,

Have you plotted the 2 headshapes in a single figure, and likewise for the gradiometers? In other words, which of the 4 objects is off in terms of expected location in space?
Have you checked for the problematic subject, whether the order of the landmark-clicking in the polhemus procedure was consistent with how the coordinate system is defined?

Best wishes,
JM

On 19 Feb 2020, at 15:15, joachim.lange at med.uni<mailto:joachim.lange at med.uni>-
duesseldorf.de<http://duesseldorf.de><mailto:joachim.lange at med.uni-duesseldorf.de> wrote:

Dear Fieldtrippers,
I’m not sure whether my problem is a Fieldtrip or a Neuromag problem, but maybe someone can help me here.

I’ve recorded MEG data with a Neuromag system and the headshape and hpi coils using the polhemus system. When I read the headshape and the sensor locations from the fif-file and plot them using Fieldtrip, the plots look as expected, i.e., the “headshape” and the hpi coils are located within the MEG sensors / helmet (see attached example figures S1_1 and S1_2 from different angles). For one subject, however, the sensors from the hdr.grad- file seem rotated and it even looks like the “headshape” is partly outside the MEG sensors / helmet (see attached figures S2_1 and S2_2).
I have no idea what is going wrong here and/or how I could correct the apparently wrong positions. Any help would be much appreciated.
Thanks,
Jo

Ps: the simple FT-code:

hdr = ft_read_header(‘subject.fif’);
headshape = ft_read_headshape(‘subject.fif’); figure; ft_plot_sens(hdr.grad, 'style', 'b.', 'coil', 'false'); ft_plot_mesh(headshape.pos(1:4,:),'vertexsize',20,'vertexcolor','r'); %HPI coils ft_plot_mesh(headshape.pos(5:end,:),'vertexsize',20,'vertexcolor','k');
%”manual” headshape
<S1_1.tif><S1_2.tif><S2_1.tif><S2_2.tif>___________________________
____________________
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/20200227/e4
8fc5ac/attachment-0001.htm>




From jan.schoffelen at donders.ru.nl  Fri Mar  6 13:37:18 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 6 Mar 2020 12:37:18 +0000
Subject: [FieldTrip] positions of Neuromag sensors rotated
In-Reply-To: <0ffbdc2ea38d4bb1b4f221b904bd1b11@med.uni-duesseldorf.de>
References: <0ffbdc2ea38d4bb1b4f221b904bd1b11@med.uni-duesseldorf.de>
Message-ID: <38C63462-5E7F-41FF-860D-B4522260EA1F@donders.ru.nl>

Dear Jo,

Thanks for the update. It’s always nice to hear back from people, although in your case it’s a pity to hear that it might be something unresolvable. I am surprised though that the discrepancy is so big. So, if I understand you well, it could be that the position between the subject and the polhemus’ reference point was not fixed over time, and specifically that it changed between the timewindow in which the ‘landmark clicking’ took place, in order to establish a coordinate system relative to the subject’s head, and the timewindow in which the scalp surface was sampled along with the HPI coil positions. Couldn’t this be easily verified by looking up the LPA/RPA/nasion points in the polhemus file? (at least, in our Polhemus procedure this information is available).

Best wishes,
JM
 

> On 6 Mar 2020, at 08:28, joachim.lange at med.uni-duesseldorf.de wrote:
> 
> Hi Jan-Mathijs,
> Just a brief update: I got feedback from other researchers who experienced similar problems. In their case the problem was that the reference point of the polhemus system (which is fixed at "glasses") had moved somehow during the measurement resulting in a rotated coordinate system. Have to check whether this is really the problem for me as well, but given the very similar problems it's pretty likely. That would mean that there is actually no solution for the problem ...
> Thanks for your help anyway,
> Jo
> 
> Date: Fri, 28 Feb 2020 09:18:32 +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] positions of Neuromag sensors rotated
> Message-ID: <91D47250-8461-48E9-A60A-02E2E5F3C93B at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Hi Jo,
> Is there another way in which you can check the  coregistration information in the fif-file? E.g. in the Elekta,  apologies, Megin software? If I recall well, but I am no expert here, there may be various coordinate systems defined in the fif-files, and it could be that something went wrong there.
> 
> Best wishes,
> JM
> 
> 
> On 28 Feb 2020, at 09:41, joachim.lange at med.uni-duesseldorf.de<mailto:joachim.lange at med.uni-duesseldorf.de> wrote:
> 
> Dear JM ;)
> Thanks for your reply and the suggestions. I had done the plotting you suggested and it's the MEG sensors of the problematic subject that are off. I also had a second look at the landmarks (and the other polhemus recordings in the "headshape" variable) but couldn't find anything suspicious.
> Best,
> Jo
> 
> 
> Date: Thu, 27 Feb 2020 08:58:27 +0000
> 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>>
> Subject: Re: [FieldTrip] positions of Neuromag sensors rotated
> Message-ID: <65A8AC04-6811-404A-B470-96893F76D805 at donders.ru.nl<mailto:65A8AC04-6811-404A-B470-96893F76D805 at donders.ru.nl>>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Jo,
> 
> Have you plotted the 2 headshapes in a single figure, and likewise for the gradiometers? In other words, which of the 4 objects is off in terms of expected location in space?
> Have you checked for the problematic subject, whether the order of the landmark-clicking in the polhemus procedure was consistent with how the coordinate system is defined?
> 
> Best wishes,
> JM
> 
> On 19 Feb 2020, at 15:15, joachim.lange at med.uni<mailto:joachim.lange at med.uni>-
> duesseldorf.de<http://duesseldorf.de><mailto:joachim.lange at med.uni-duesseldorf.de> wrote:
> 
> Dear Fieldtrippers,
> I’m not sure whether my problem is a Fieldtrip or a Neuromag problem, but maybe someone can help me here.
> 
> I’ve recorded MEG data with a Neuromag system and the headshape and hpi coils using the polhemus system. When I read the headshape and the sensor locations from the fif-file and plot them using Fieldtrip, the plots look as expected, i.e., the “headshape” and the hpi coils are located within the MEG sensors / helmet (see attached example figures S1_1 and S1_2 from different angles). For one subject, however, the sensors from the hdr.grad- file seem rotated and it even looks like the “headshape” is partly outside the MEG sensors / helmet (see attached figures S2_1 and S2_2).
> I have no idea what is going wrong here and/or how I could correct the apparently wrong positions. Any help would be much appreciated.
> Thanks,
> Jo
> 
> Ps: the simple FT-code:
> 
> hdr = ft_read_header(‘subject.fif’);
> headshape = ft_read_headshape(‘subject.fif’); figure; ft_plot_sens(hdr.grad, 'style', 'b.', 'coil', 'false'); ft_plot_mesh(headshape.pos(1:4,:),'vertexsize',20,'vertexcolor','r'); %HPI coils ft_plot_mesh(headshape.pos(5:end,:),'vertexsize',20,'vertexcolor','k');
> %”manual” headshape
> <S1_1.tif><S1_2.tif><S2_1.tif><S2_2.tif>___________________________
> ____________________
> 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/20200227/e4
> 8fc5ac/attachment-0001.htm>
> 
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202




From jiversen at ucsd.edu  Sat Mar  7 01:36:54 2020
From: jiversen at ucsd.edu (Iversen, John)
Date: Sat, 7 Mar 2020 00:36:54 +0000
Subject: [FieldTrip] Important Update: 4th International MoBI Conference,
 San Diego, June 7-10
Message-ID: <D8225970-B440-4F94-A5E4-1A981336EAFA@ucsd.edu>

Dear Friends and Colleagues,

We're gratified by the excellent submissions to the 4th International Mobile Brain/Body Imaging Conference (San Diego, June 7-10). Note: it is not too late to submit<https://sites.google.com/ucsd.edu/mobi2020/registration-submission>!

* We would like to reassure you that as of now, the MoBI conference will proceed as planned. June is still months away and the situation could change, so we will be carefully monitoring the evolving situation with coronavirus and travel restrictions and will keep you posted. Please check http://mobi2020.ucsd.edu<http://mobi2020.ucsd.edu/> for updates.

* Several people have contacted us with uncertainties about travel, and in response, we will offer the opportunity to participate remotely via videoconference to those who are unable or prefer not to travel in June.

* Finally, given the general uncertainty, if you need extra time, we will extend the abstract submission deadline to March 20th.

Looking forward to a fantastic meeting.

Best regards,

John Iversen & Klaus Gramann (Co-Chairs)

We are excited to invite you to San Diego for the 4TH INTERNATIONAL MOBILE BRAIN/BODY IMAGING (MoBI) CONFERENCE, which will take place *June 7-10, 2020* at the University of California San Diego hosted by the Swartz Center for Computational Neuroscience.

* Abstract submission is now open (*Extended Deadline March 20, 2020*) and discounted Early-Bird Registration is available through April 7st. Full conference information can be found at http://mobi2020.ucsd.edu<http://mobi2020.ucsd.edu/>.

Mobile Brain/Body Imaging (MoBI) is a maturing imaging approach employing mobile brain imaging methods synchronized to body motion capture and other behavioral and psychophysiological data streams to investigate brain dynamics accompanying natural cognitive and affective processes as humans interact with their environment and/or with others. MoBI2020 follows three highly successful conferences in Delmenhorst, Cancun and Berlin.

We hope you will join us for this dynamic meeting with enthusiastic MoBI researchers from all over the world and to enjoy the delights of San Diego in summertime. Sharing your ideas and projects with us will be a great opportunity for many researchers to learn and become even more motivated to work in this exciting field. The 2020 MoBI meeting will maintain the philosophy of the first meetings, where international leading experts in the field of MoBI will present ongoing research in different areas of MoBI.  We have three stimulating Keynotes planned by Stefan Debener (Benefits and pitfalls of wearable EEG), Laurel Trainor (Rhythm, prediction and multi-person interaction in music), and Sarah Robinson (Extended Organisms/Surrogate Bodies).  Oral sessions will include the latest developments in imaging hardware, new software solutions to record and analyze multi-modal data streams, and MoBI applications in a wide range of research areas including spatial cognition, motor control, gait rehabilitation, sport science, music and dance, therapeutic interventions and others.

We invite your submission that will allow for the opportunity to present and discuss your work. There will be ample time for informal interactions to foster transdisciplinary research ideas, provide the opportunity to learn about new perspectives and methods, and develop potential collaborative partnerships.

Students and Postdoctoral fellows are especially invited to apply, with discounted registration.

You can find more information about the conference, including venues, conference fees and a preliminary program here: http://mobi2020.ucsd.edu<http://mobi2020.ucsd.edu/>. Please visit for regular updates and announcements. In case you have questions or comments please contact John Iversen (jiversen at ucsd.edu<mailto:jiversen at ucsd.edu>).

Please circulate this announcement to colleagues and trainees. Our apologies if you have received multiple announcements through different lists.

We hope to welcome you in San Diego this June!

With our best regards,

John Iversen and Klaus Gramann (Co-Chairs)

--
John R. Iversen, PhD
University of California, San Diego
Associate Director, Swartz Center for Computational Neuroscience
Institute for Neural Computation
9500 Gilman Dr #0559
La Jolla, CA 92093
jiversen at ucsd.edu<mailto:jiversen at ucsd.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200307/5fb3cae7/attachment.htm>

From iris.steinmann at med.uni-goettingen.de  Mon Mar  9 09:27:30 2020
From: iris.steinmann at med.uni-goettingen.de (Steinmann, Iris)
Date: Mon, 9 Mar 2020 08:27:30 +0000
Subject: [FieldTrip] manually marked artifacts in ft_databrowser
Message-ID: <A0898A0619E8724487198481181011B40172D56929@umg-exc-3.ads.local.med.uni-goettingen.de>

Dear fieldtrip experts,

when I use ft_databrowser and mark trials manually as artifacts ('visual'), some (but not all) of these are again unmarked when I scroll back to them later. First I thought its maybe a problem with displaying the manually marked trials in the databrowser window, but when I close the ft_databrowser window, these trials are also not stored in the cfg.artifacts.artfctdef.visual.
I'm using MATLAB 2015 b on a Linux machine with fieldtrip-20181122. Down below is the full code I'm using for the ft_databrowser plot.

Thanks for any idea!
Cheers!

Iris

cfg = [];
cfg.channel = 'eeg';
cfg.viewmode = 'vertical';
cfg.preproc.lpfilter = 'yes';
cfg.preproc.lpfreq = 45;
cfg.artfctdef.stat.artifact = artifact_stat;
cfg.selectfeature = 'visual';
cfg.selectmode = 'markartifact';
cfg = ft_databrowser(cfg, data);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200309/595811e3/attachment.htm>

From S.Arana at donders.ru.nl  Mon Mar  9 09:57:13 2020
From: S.Arana at donders.ru.nl (Arana, S.L. (Sophie))
Date: Mon, 9 Mar 2020 08:57:13 +0000
Subject: [FieldTrip] manually marked artifacts in ft_databrowser
In-Reply-To: <A0898A0619E8724487198481181011B40172D56929@umg-exc-3.ads.local.med.uni-goettingen.de>
References: <A0898A0619E8724487198481181011B40172D56929@umg-exc-3.ads.local.med.uni-goettingen.de>
Message-ID: <1583744233289.87537@donders.ru.nl>

Dear Iris,


the behavior of ft_databrowser you report is not normal, but it is difficult to debug because I cannot reproduce this error. You report that only some of the marks disappear, can you systematically reproduce when this happens exactly? Probably best to first try and update your fieldtrip version and see if this solves the problem.

In ft_databrowser if you mark the same artifact twice (by selecting and then clicking on selection) the mark will disappear again. Could it be that this is what happened? Also you are already providing the function with an artifact definition 'artifact_stat' could it be that you accidentally marked artifacts as 'stat' and not 'visual' and that's the reason why they do not appear in the output?


best,

Sophie

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Steinmann, Iris <iris.steinmann at med.uni-goettingen.de>
Sent: Monday, March 9, 2020 9:27 AM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] manually marked artifacts in ft_databrowser

Dear fieldtrip experts,

when I use ft_databrowser and mark trials manually as artifacts ('visual'), some (but not all) of these are again unmarked when I scroll back to them later. First I thought its maybe a problem with displaying the manually marked trials in the databrowser window, but when I close the ft_databrowser window, these trials are also not stored in the cfg.artifacts.artfctdef.visual.
I'm using MATLAB 2015 b on a Linux machine with fieldtrip-20181122. Down below is the full code I'm using for the ft_databrowser plot.

Thanks for any idea!
Cheers!

Iris

cfg = [];
cfg.channel = 'eeg';
cfg.viewmode = 'vertical';
cfg.preproc.lpfilter = 'yes';
cfg.preproc.lpfreq = 45;
cfg.artfctdef.stat.artifact = artifact_stat;
cfg.selectfeature = 'visual';
cfg.selectmode = 'markartifact';
cfg = ft_databrowser(cfg, data);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200309/203641e2/attachment.htm>

From sauppe.s at gmail.com  Mon Mar  9 10:19:26 2020
From: sauppe.s at gmail.com (Sebastian Sauppe)
Date: Mon, 9 Mar 2020 10:19:26 +0100
Subject: [FieldTrip] =?utf-8?q?Two_PhD_student_positions_available_?=
 =?utf-8?q?=E2=80=93_neural_oscillations_during_language_planning?=
Message-ID: <EC88AFBA-C26F-42B4-8E09-BE2EFE28D3F1@gmail.com>

With the launch of a new ‘NCCR Evolving Language’ (http://www.snf.ch/SiteCollectionDocuments/nfs/Faktenblatt_NCCR_evolvinglanguage_en.pdf <http://www.snf.ch/SiteCollectionDocuments/nfs/Faktenblatt_NCCR_evolvinglanguage_en.pdf>), which involves nearly 40 different research groups from a large variety of disciplines across Switzerland, we seek to fill two fully funded PhD student positions for a four-year project starting in May 2020.

Our goal is to understand how hierarchical syntactic structures are generated during speaking in the brain. The tools that we use in the Work Package “Structure Planning” to this end are neural oscillatory power analyses and eye tracking. PhD student 1 will investigate the planning and production of syntactic structures of varying complexity in EEG and eye tracking experiments on German and French. PhD student 2 will use intracranial EEG data to study the neural underpinnings of syntactic planning processes in French narrative speech, integrating methods from computational linguistics (e.g. corpus-based information theoretic measures) and machine learning (e.g. bringing together EEG signals and speech patterns).

The PhD students will be based at the University of Zurich (Prof. Martin Meyer, Prof. Balthasar Bickel, Dr. Sebastian Sauppe) and will closely collaborate with the Auditory, Speech and Language Neuroscience group (Prof. Anne-Lise Giraud) and the Brain and Language Lab (Prof. Narly Golestani) at the University of Geneva. The working language in the project is English.

PhD student 1:

The ideal candidate holds an MA/MSc in psychology, linguistics, cognitive science or a related field, has a basic knowledge of syntax and linguistics, and has an interest in the experimental study of language processing and production. Knowledge of German is essential; knowledge of French is an advantage, otherwise willingness to acquire a working knowledge of the language quickly is essential. The ideal candidate also possesses prior experience with one or more of the following: experimental studies, EEG and/or eye tracking, programming (R, Python, MATLAB), statistical data analysis.

PhD student 2:

The ideal candidate holds an MA/MSc in (computational) linguistics, cognitive science, psychology, computer science or a related field, has a basic knowledge of syntax and linguistics, and has an interest in the experimental study of language processing and production. The ideal candidate also possesses experience with programming (R, Python), machine learning techniques and computational linguistics tools; experience with EEG is an advantage. Fluent French in speaking and writing is an essential requirement.

Apart from their CVs, applicants should submit

- A sample of their writing (e.g., excerpt from their master’s thesis),

- Names of 2-3 persons willing to provide a letter of reference, and

- A cover letter explaining their expertise and interest in the topic and the project and indicating which PhD student position is being applied for.

The NCCR places great emphasis on gender diversity and we particularly encourage women to apply.

Applications should be sent as a single PDF to structure-planning-phd at ivs.uzh.ch <mailto:structure-planning-phd at ivs.uzh.ch> <mailto:>, with subject header “Structure Planning PhD”. Application deadline is March 30, 2020. Interviews (via Skype) will be conducted on April 2 and 3. The starting date is May 1, 2020. For further information contact martin.meyer at uzh.ch <mailto:martin.meyer at uzh.ch> or sebastian.sauppe at uzh.ch <mailto:sebastian.sauppe at uzh.ch>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200309/09ff446f/attachment.htm>

From behzadiravani at gmail.com  Mon Mar  9 11:11:11 2020
From: behzadiravani at gmail.com (Behzad Iravani)
Date: Mon, 9 Mar 2020 11:11:11 +0100
Subject: [FieldTrip] Source reconstruction - finding the inverse of cross
 spectral density
Message-ID: <CAHcwWFE_honLiOh6-CWejBf9hb+t1QtDHLVVCVCNDSdnsb9LLw@mail.gmail.com>

Hello,

Thanks a lot for your awesome toolbox, I had  a question regarding the
estimation of inverse matrix of cross spectral density in source
reconstruction pipeline. I noticed the method has been changed since 2018,
that used to be using *pinv *function that seemingly similar to Matlab
function , to fieldtrip function *ft_inv *that implemented different
methods of estimating inverse matrix. However when we ran our script using
the default configuration in newer than 2018 version of fieldtrip we get
different result as we used to have in 2018. We would like to know if there
is a specific change in *ft_inv* that we can not replicate the finding we
used to get with *pinv.  *

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200309/8b562a4d/attachment.htm>

From e.spaak at donders.ru.nl  Mon Mar  9 16:41:17 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Mon, 9 Mar 2020 16:41:17 +0100
Subject: [FieldTrip] Source reconstruction - finding the inverse of
 cross spectral density
In-Reply-To: <CAHcwWFE_honLiOh6-CWejBf9hb+t1QtDHLVVCVCNDSdnsb9LLw@mail.gmail.com>
References: <CAHcwWFE_honLiOh6-CWejBf9hb+t1QtDHLVVCVCNDSdnsb9LLw@mail.gmail.com>
Message-ID: <CABPNLUqL+LzWO90RgvQxznDFF1UOzjVhuB8MADEnJuge_Am5oA@mail.gmail.com>

Hi Behzad,

See this issue on Github:
https://github.com/fieldtrip/fieldtrip/issues/1020 Bottom line (also
after a lot of discussion off-line among Robert, Jan-Mathijs, and
myself) is that there is no clear fact of the matter as to whether the
old or the new behaviour is correct (both are). The differences depend
on when and how regularization is applied. You're welcome to chime in
on the Github issue I mentioned.

Best,
Eelke

On Mon, 9 Mar 2020 at 11:11, Behzad Iravani <behzadiravani at gmail.com> wrote:
>
> Hello,
>
> Thanks a lot for your awesome toolbox, I had  a question regarding the estimation of inverse matrix of cross spectral density in source reconstruction pipeline. I noticed the method has been changed since 2018, that used to be using pinv function that seemingly similar to Matlab function , to fieldtrip function ft_inv that implemented different methods of estimating inverse matrix. However when we ran our script using the default configuration in newer than 2018 version of fieldtrip we get different result as we used to have in 2018. We would like to know if there is a specific change in ft_inv that we can not replicate the finding we used to get with pinv.
>
> Best regards
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202



From sauppe.s at gmail.com  Tue Mar 10 14:55:47 2020
From: sauppe.s at gmail.com (Sebastian Sauppe)
Date: Tue, 10 Mar 2020 14:55:47 +0100
Subject: [FieldTrip] =?utf-8?q?=5BUPDATED=5D_Two_PhD_student_positions_av?=
 =?utf-8?q?ailable_=E2=80=93_neural_oscillations_during_language_planning?=
Message-ID: <86BC3311-B0AA-433C-8639-24B0316C8974@gmail.com>

[UPDATED: THE APPLICATON DEADLINES CHANGED]

With the launch of a new ‘NCCR Evolving Language’ (http://www.snf.ch/SiteCollectionDocuments/nfs/Faktenblatt_NCCR_evolvinglanguage_en.pdf <http://www.snf.ch/SiteCollectionDocuments/nfs/Faktenblatt_NCCR_evolvinglanguage_en.pdf>), which involves nearly 40 different research groups from a large variety of disciplines across Switzerland, we seek to fill two fully funded PhD student positions for a four-year project starting in May 2020.

Our goal is to understand how hierarchical syntactic structures are generated during speaking in the brain. The tools that we use in the Work Package “Structure Planning” to this end are neural oscillatory power analyses and eye tracking. PhD student 1 will investigate the planning and production of syntactic structures of varying complexity in EEG and eye tracking experiments on German and French. PhD student 2 will use intracranial EEG data to study the neural underpinnings of syntactic planning processes in French narrative speech, integrating methods from computational linguistics (e.g. corpus-based information theoretic measures) and machine learning (e.g. bringing together EEG signals and speech patterns). 

The PhD students will be based at the University of Zurich (Prof. Martin Meyer, Prof. Balthasar Bickel, Dr. Sebastian Sauppe) and will closely collaborate with the Auditory, Speech and Language Neuroscience group (Prof. Anne-Lise Giraud) and the Brain and Language Lab (Prof. Narly Golestani) at the University of Geneva. The working language in the project is English.

PhD student 1:

The ideal candidate holds an MA/MSc in psychology, linguistics, cognitive science or a related field, has a basic knowledge of syntax and linguistics, and has an interest in the experimental study of language processing and production. Knowledge of German is essential; knowledge of French is an advantage, otherwise willingness to acquire a working knowledge of the language quickly is essential. The ideal candidate also possesses prior experience with one or more of the following: experimental studies, EEG and/or eye tracking, programming (R, Python, MATLAB), statistical data analysis. 

PhD student 2:

The ideal candidate holds an MA/MSc in (computational) linguistics, cognitive science, psychology, computer science or a related field, has a basic knowledge of syntax and linguistics, and has an interest in the experimental study of language processing and production. The ideal candidate also possesses experience with programming (R, Python), machine learning techniques and computational linguistics tools; experience with EEG is an advantage. Fluent French in speaking and writing is an essential requirement.

Apart from their CVs, applicants should submit 

- A sample of their writing (e.g., excerpt from their master’s thesis), 

- Names of 2-3 persons willing to provide a letter of reference, and 

- A cover letter explaining their expertise and interest in the topic and the project and indicating which PhD student position is being applied for. 

The NCCR places great emphasis on gender diversity and we particularly encourage women to apply.

Applications should be sent as a single PDF to structure-planning-phd at ivs.uzh.ch <mailto:structure-planning-phd at ivs.uzh.ch>, with subject header “Structure Planning PhD”. Applications will be reviewed starting March 30. The position remains open until filled. For further information contact martin.meyer at uzh.ch <mailto:martin.meyer at uzh.ch> or sebastian.sauppe at uzh.ch <mailto:sebastian.sauppe at uzh.ch>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200310/8f2bb3e0/attachment.htm>

From events.biopsych at ovgu.de  Tue Mar 10 15:09:53 2020
From: events.biopsych at ovgu.de (events.biopsych at ovgu.de)
Date: Tue, 10 Mar 2020 14:09:53 +0000
Subject: [FieldTrip] Last Call: Deep Neural Network workshop (July 2020,
 Magdeburg, Germany)
In-Reply-To: <20200113081342.Horde.LEPQe2u7cTXEGU_tC9mKQGS@webmailer.ovgu.de>
References: <20191115123332.Horde.rgH1dlrAK0HVOan6pZCHUta@webmailer.ovgu.de>
 <20200113081342.Horde.LEPQe2u7cTXEGU_tC9mKQGS@webmailer.ovgu.de>
Message-ID: <20200310140953.Horde.zW3STr0R1a8iOCRcLfq_EKy@webmailer.ovgu.de>

Please forward this mail to anyone who might be interested in  
attending the workshop.

-----
Dear fellow scientists,

This is the last call for the 4th Modelling Symposium in Magdeburg  
(27.07.2020 - 31.07.2020) - an introduction into Deep Neural Networks  
(DNNs). For more details and registration, please visit our website:

https://www.noesseltlab.org/events-presentations/4th-modelling-symposium/

Summary/ General information:
•        27.07.2020 - 31.07.2020 (4-day Workshop) in Magdeburg, Germany.
•        registration deadline: March, 31st (2020).
•        possibilities to present your research/research idea (Poster)  
and discuss your project ideas/data with our tutor

Looking forward to see you in Magdeburg,

Felix Ball, Nico Marek, & Tömme Noesselt



From r.oostenveld at donders.ru.nl  Wed Mar 11 10:50:04 2020
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 11 Mar 2020 10:50:04 +0100
Subject: [FieldTrip] Special Issue - Rhythms in Cognition: Revisiting the
 Evidence | European Journal of Neuroscience
References: <DB8PR03MB6137E63706D02810C32186FCBFFF0@DB8PR03MB6137.eurprd03.prod.outlook.com>
Message-ID: <1FF3D9A4-251D-4689-BBC6-83651A5AF81E@donders.ru.nl>


> Begin forwarded message:
> 
> From: Christian Keitel <christian.keitel at STIR.AC.UK>
> Subject: [megcommunity] Special Issue - Rhythms in Cognition: Revisiting the Evidence | European Journal of Neuroscience
> Date: 10 March 2020 at 22:46:07 CET
> To: MEGCOMMUNITY at JISCMAIL.AC.UK
> Reply-To: Christian Keitel <christian.keitel at STIR.AC.UK>
> 
> *Apologies for cross-postings*
>  
> Dear MEG community,
>  
> We have recently announced a Call-for-Papers for a special issue of The European Journal of Neuroscience <https://urldefense.proofpoint.com/v2/url?u=http-3A__onlinelibrary.wiley.com_journal_10.1111_-28ISSN-291460-2D9568&d=DwMFaQ&c=4sF48jRmVAe_CH-k9mXYXEGfSnM3bY53YSKuLUQRxhA&r=HndAjw7LcAe0Xm1klC-dLxO_Kr7TllX7LjySDmu5jDU&m=UQthcNy0zYG5HjtbBU0cBH3vfIfNtXZKXAv-ThAhmJk&s=a6nxD-0TWe2Oze_bpICMGRBn_uKcCMU8XgaGl2D0HZY&e=> on “Rhythms in cognition: Revisiting the Evidence”.  The Call-for-Papers can be found here <https://urldefense.proofpoint.com/v2/url?u=https-3A__onlinelibrary.wiley.com_pb-2Dassets_assets_14609568_Call-2520for-2520Papers_Call-2520for-2520Papers-2520Rhythms-2520in-2520cognition-2D1575906884733.pdf&d=DwMFaQ&c=4sF48jRmVAe_CH-k9mXYXEGfSnM3bY53YSKuLUQRxhA&r=HndAjw7LcAe0Xm1klC-dLxO_Kr7TllX7LjySDmu5jDU&m=UQthcNy0zYG5HjtbBU0cBH3vfIfNtXZKXAv-ThAhmJk&s=mr-UiIHz8sx9MZpQtnGEkUIZ-47BHix41CEr_rsvYSs&e=>.
>  
> The issue will be edited by: Christian Keitel (University of Stirling, UK), Manuela Ruzzoli (University of Glasgow, UK), Chris Benwell (University of Dundee, UK), Niko Busch (University of Muenster, Germany), and Laura Dugué (Université de Paris, Paris Descartes, France).  The deadline for manuscript submissions is set for July 31, 2020 with an estimated date of publication of late summer 2021, although we will process and publish papers online on an ongoing basis.
>  
> Everyday experience may arise from a fundamentally discrete perceptual sampling of our sensory environment.  Furthermore, we have come to see brain rhythms as the neural implementation of perceptual sampling and the basis of cognitive functions such as attention, memory and language. In an interesting twist however, more recent negative findings on the role of pre-stimulus oscillatory phase on perception suggest that support for discrete sampling as a fundamental mechanism remains equivocal. 
>  
> In our Special Issue, we call for methodologically principled studies, irrespective of their outcome, to provide us with the most detailed picture to-date as to the conditions under which perceptual sampling, and its consequences for cognition, can (not) be observed. These studies can be original contributions, replication attempts, pre-registered studies or file-drawer experiments that have to follow a thorough methodology and thus allow clear interpretations also of negative findings. We further welcome dedicated reviews, opinion pieces and methodological advances.
>  
> We would be very pleased if you would consider contributing a paper to this issue. All submissions will undergo rigorous, fast, fair and open peer review. Please do let us know if you intend to submit a paper as we would like to keep track of potential contributions. 
> 
>  
> In Science,​
>  
> John Foxe and Paul Bolam
> Co-Editors-in-Chief, European Journal of Neuroscience
> 
> Christian Keitel, Manuela Ruzzoli, Chris Benwell, Niko Busch, Laura Dugué
> Co-Guest Editors, SI: Rhythms in Cognition, European Journal of Neuroscience
> 
>  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200311/c5fc9cd0/attachment.htm>

From rpriefer at adelphi.edu  Wed Mar 11 14:50:52 2020
From: rpriefer at adelphi.edu (Ryan Priefer)
Date: Wed, 11 Mar 2020 09:50:52 -0400
Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
Message-ID: <CAHto=cjaw+-_NKHNMy4Rkp1YeeFu7dd6xjAq-iysH-yj2nB2cA@mail.gmail.com>

Hello,

I work as a Lab Coordinator for the Neurocognition of Communication
Disorders Lab at Adelphi University, New York. We are looking to perform a
cluster-based permutation test on our EEG data but have some questions as
we are quite unfamiliar with how to apply it to this data in particular,
and neither of us are too familiar with Matlab code.

We collect our EEG data using a 128-HydroCel Geodesic Sensor Net from
EGI/Philips, and therefore we have used NetStation to do most of our
processing in the past.

We have attempted to utilize the bountiful tutorials FieldTrip provides on
their website and YouTube channel but to no avail. Specifically, we were
using this <https://pastebin.com/yskmVKAh> code alongside this
<https://vimeo.com/45658196> workshop video. We are simply not savvy enough
with Matlab code, despite these resources, and would really appreciate if
someone could provide some clarity on the process. Even the tutorials seem
to assume the user is knowledgeable about Matlab code/certain, intricate
things about the data itself that we just are not.

We get stuck quite early on, particularly because we don't know what
cfg.headerformat, cfg.dataformat, and cfg.eventformat would be for our
system, as this seems to specify for the neuroscan system :

   1. cfg=[]; % empties the universally used cfg-structure
   2. cfg.dataset=data{1}; % which dataset? Useful if a for-loop is used
   3. cfg.trialdef.eventtype= '?'; % We don't know what events have happened
   4. cfg.headerformat='ns_cnt32'; % Watch Out! With the neuroscan system,
   you have to set the bit-rate
   5. cfg.dataformat='ns_cnt32'; % Otherwise you'll have corrupt data
   6. cfg.eventformat='ns_cnt32';


Some additional questions:

Do you suggest beginning with a raw file and doing all processing in
fieldtrip for the best results? As of now we have been using a combination
of EEGLAB and NetStation 5 to process the data. We are assuming and hoping
that all of this fieldtrip analysis could be one on a completely processed,
averaged EEG file - but what file type works best? The default for EGI is
.mff, but we could use .raw, .mat, .txt, and so on as exports from the NS5
program..

Please advise as to what to do, or what further information you'd like from
us. I apologize for potentially a loaded, vague question. We are very new
to this type of analyzing (we usually use R/RStudio).

Thank you,

-- 
Ryan Priefer
Lab Technical Coordinator
Communication Sciences and Disorders
t: 516.877.6787
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200311/5224717e/attachment.htm>

From politzerahless at gmail.com  Fri Mar 13 03:33:46 2020
From: politzerahless at gmail.com (Stephen Politzer-Ahles)
Date: Fri, 13 Mar 2020 10:33:46 +0800
Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
In-Reply-To: <mailman.9.1584010802.2443.fieldtrip@science.ru.nl>
References: <mailman.9.1584010802.2443.fieldtrip@science.ru.nl>
Message-ID: <CAJT2k_8y78dG19AQK3ZeKGtMZTayZRETWWMZ3Ts4iqi1zs4f=Q@mail.gmail.com>

Could you clarify what step of the processing this cfg code is for?
Processing data and eventually running a cluster-based permutation test
requires many steps, most of which have their own function, and each
function has its own cfg structure to go along with it (the cfg structure
is just a way of passing arguments to the function). The cfg you've put
here looks like it's related to importing the data, rather than part of
actually running the permutation test.

To get started, I would recommend reading the paper by Maris & Oostenveld
(2007), which explains the logic and procedures for the test, and going
through the tutorial at
http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock/;
that has the code you're going to need, and it comes with a dataset already
prepared, so you'll be able to go through the whole thing with the sample
data to see how it works before you try it on yours. Unfortunately, I don't
think there's any way around learning MATLAB code; to be able to run these
tests and know what you're doing (enough to avoid making mistakes, or to
notice if you do make a mistake) you will need at least basic familiarity
with MATLAB.

As for your other questions:
--I don't think the results will differ as a function of whether you import
a raw file and process within fieldtrip, or whether you process elsewhere
and then import averages. Most of the processing is going to come out the
same wherever you do it (there are some minor differences in the default
settings of the filters used by Fieldtrip vs. those used by, e.g., EEGLAB).
The bigger issue is what's easier. For me, I sometimes find it a little
difficult to import already-averaged data into fieldtrip (there surely is a
way to do it, but in my own pipeline I just hack it -- which also requires
a decent familiarity with MATLAB code and with the structure of Fieldtrip
objects). Personally I find it easier to just do the preprocessing within
Fieldtrip (YMMV, though, depending on how familiar you are with Fieldtrip).
--As for the best data type for importing, I haven't worked with EGI so I'm
not familiar with any of these or how they work with Fieldtrip, but there
definitely are other people on the mailing list who will be; I'd recommend
sending this as a separate question on its own.

---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.polyu.edu.hk/cbs/sjpolit/




> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 11 Mar 2020 09:50:52 -0400
> From: Ryan Priefer <rpriefer at adelphi.edu>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
> Message-ID:
>         <CAHto=
> cjaw+-_NKHNMy4Rkp1YeeFu7dd6xjAq-iysH-yj2nB2cA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> I work as a Lab Coordinator for the Neurocognition of Communication
> Disorders Lab at Adelphi University, New York. We are looking to perform a
> cluster-based permutation test on our EEG data but have some questions as
> we are quite unfamiliar with how to apply it to this data in particular,
> and neither of us are too familiar with Matlab code.
>
> We collect our EEG data using a 128-HydroCel Geodesic Sensor Net from
> EGI/Philips, and therefore we have used NetStation to do most of our
> processing in the past.
>
> We have attempted to utilize the bountiful tutorials FieldTrip provides on
> their website and YouTube channel but to no avail. Specifically, we were
> using this <https://pastebin.com/yskmVKAh> code alongside this
> <https://vimeo.com/45658196> workshop video. We are simply not savvy
> enough
> with Matlab code, despite these resources, and would really appreciate if
> someone could provide some clarity on the process. Even the tutorials seem
> to assume the user is knowledgeable about Matlab code/certain, intricate
> things about the data itself that we just are not.
>
> We get stuck quite early on, particularly because we don't know what
> cfg.headerformat, cfg.dataformat, and cfg.eventformat would be for our
> system, as this seems to specify for the neuroscan system :
>
>    1. cfg=[]; % empties the universally used cfg-structure
>    2. cfg.dataset=data{1}; % which dataset? Useful if a for-loop is used
>    3. cfg.trialdef.eventtype= '?'; % We don't know what events have
> happened
>    4. cfg.headerformat='ns_cnt32'; % Watch Out! With the neuroscan system,
>    you have to set the bit-rate
>    5. cfg.dataformat='ns_cnt32'; % Otherwise you'll have corrupt data
>    6. cfg.eventformat='ns_cnt32';
>
>
> Some additional questions:
>
> Do you suggest beginning with a raw file and doing all processing in
> fieldtrip for the best results? As of now we have been using a combination
> of EEGLAB and NetStation 5 to process the data. We are assuming and hoping
> that all of this fieldtrip analysis could be one on a completely processed,
> averaged EEG file - but what file type works best? The default for EGI is
> .mff, but we could use .raw, .mat, .txt, and so on as exports from the NS5
> program..
>
> Please advise as to what to do, or what further information you'd like from
> us. I apologize for potentially a loaded, vague question. We are very new
> to this type of analyzing (we usually use R/RStudio).
>
> Thank you,
>
> --
> Ryan Priefer
> Lab Technical Coordinator
> Communication Sciences and Disorders
> t: 516.877.6787
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200311/5224717e/attachment-0001.htm
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200313/03284d16/attachment.htm>

From anapesquita at gmail.com  Fri Mar 13 14:58:39 2020
From: anapesquita at gmail.com (Ana Pesquita)
Date: Fri, 13 Mar 2020 13:58:39 +0000
Subject: [FieldTrip] ft_freqanalysis :: Warning: output frequencies are
 different from input frequencies
Message-ID: <CAPXbk7kNNwa7szhHDgTSxw1KWJwWACUA8FXNpJbszASdWPCcuQ@mail.gmail.com>

Hello all,

I having difficulties with ft_freqanalysis.

*1) Problem:*
I am trying to compute frequencies at 0.1 Hz steps between 4 and 120 Hz.
But I am getting the following Warning back:

"Warning: output frequencies are different from input frequencies,
multiples of the same bin were requested but not given
trial 1, frequency 28 (129.57 Hz), 1 tapers
the call to "ft_freqanalysis" took 0 seconds"

And the frequency output is only of 28 different frequency values.

*2) Procedure:*
I am feeding in a structure to the  ft_freqanalysis with the following
characteristics:
svd_cd  struct with fields
    trialinfo: 'Int'
        trial: {[1×301 double]}
        label: {'MISC004xSVD'}
         time: {[1×301 double]}

This is my fieldtrip cal for frequency analysis:
%Compute FT
cfg = [];
cfg.output = 'pow';
cfg.taper = 'hanning';
cfg.method = 'mtmconvol';
cfg.foi          =  40:0.1:130;
cfg.t_ftimwin    =  5 ./cfg.foi ;
cfg.toi          = [-0.150 : 0.01: 0.150];
cfg.keeptrials = 'no';
tfr4 = ft_freqanalysis(cfg, svd_cd);

And the result:
tfr4 =

  struct with fields:

        label: {'MISC004xSVD'}
       dimord: 'chan_freq_time'
         freq: [1×28 double]
         time: [1×31 double]
    powspctrm: [1×28×31 double]
          cfg: [1×1 struct]

*3) Question:*
Can you identify why I can't get back the same number of output frequencies
as I am requesting in the cfg.foi request? Is there a way to get around
this?

Hope everyone is doing well : )
Many thanks in advance for your help!

Ana Pesquita
Postdoctoral Researcher
Center for Human Brain Health
University Of Birmingham, UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200313/d938fa35/attachment.htm>

From rpriefer at adelphi.edu  Fri Mar 13 18:29:17 2020
From: rpriefer at adelphi.edu (Ryan Priefer)
Date: Fri, 13 Mar 2020 10:29:17 -0700
Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
In-Reply-To: <CAJT2k_8y78dG19AQK3ZeKGtMZTayZRETWWMZ3Ts4iqi1zs4f=Q@mail.gmail.com>
References: <mailman.9.1584010802.2443.fieldtrip@science.ru.nl>
 <CAJT2k_8y78dG19AQK3ZeKGtMZTayZRETWWMZ3Ts4iqi1zs4f=Q@mail.gmail.com>
Message-ID: <CAHto=cjyjCJ5U733KM9XE8057G1NUqCfNrSnm8VBN444Hrc+pA@mail.gmail.com>

Good afternoon,

According to the tutorial I was using (link provided in original message)
this was at the very beginning of processing. So, in this case, we were
using a raw .mff file that had no previous processing done. This tutorial
ran in tandem with a video (link also provided prior) and so I attempted to
follow the steps that way. Therefore - yes, the error we ran into was
simply importing the data! This is our first issue in our overall goal of
attempting to run a CBPT, so you are correct there. So our issue here is
not fully understanding the information related to importing the data (as
the example uses Neuroscan headers, etc. which are different from ours, of
course).

I appreciate the paper you shared. I will look into it and keep working on
this. With our little knowledge of Matlab code, trying to figure out errors
in the code provides its own challenges, so this is all new to us.

Many thanks!

On Thu, Mar 12, 2020 at 7:34 PM Stephen Politzer-Ahles <
politzerahless at gmail.com> wrote:

> Could you clarify what step of the processing this cfg code is for?
> Processing data and eventually running a cluster-based permutation test
> requires many steps, most of which have their own function, and each
> function has its own cfg structure to go along with it (the cfg structure
> is just a way of passing arguments to the function). The cfg you've put
> here looks like it's related to importing the data, rather than part of
> actually running the permutation test.
>
> To get started, I would recommend reading the paper by Maris & Oostenveld
> (2007), which explains the logic and procedures for the test, and going
> through the tutorial at
> http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock/;
> that has the code you're going to need, and it comes with a dataset already
> prepared, so you'll be able to go through the whole thing with the sample
> data to see how it works before you try it on yours. Unfortunately, I don't
> think there's any way around learning MATLAB code; to be able to run these
> tests and know what you're doing (enough to avoid making mistakes, or to
> notice if you do make a mistake) you will need at least basic familiarity
> with MATLAB.
>
> As for your other questions:
> --I don't think the results will differ as a function of whether you
> import a raw file and process within fieldtrip, or whether you process
> elsewhere and then import averages. Most of the processing is going to come
> out the same wherever you do it (there are some minor differences in the
> default settings of the filters used by Fieldtrip vs. those used by, e.g.,
> EEGLAB). The bigger issue is what's easier. For me, I sometimes find it a
> little difficult to import already-averaged data into fieldtrip (there
> surely is a way to do it, but in my own pipeline I just hack it -- which
> also requires a decent familiarity with MATLAB code and with the structure
> of Fieldtrip objects). Personally I find it easier to just do the
> preprocessing within Fieldtrip (YMMV, though, depending on how familiar you
> are with Fieldtrip).
> --As for the best data type for importing, I haven't worked with EGI so
> I'm not familiar with any of these or how they work with Fieldtrip, but
> there definitely are other people on the mailing list who will be; I'd
> recommend sending this as a separate question on its own.
>
> ---
> Stephen Politzer-Ahles
> The Hong Kong Polytechnic University
> Department of Chinese and Bilingual Studies
> http://www.polyu.edu.hk/cbs/sjpolit/
>
>
>
>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 11 Mar 2020 09:50:52 -0400
>> From: Ryan Priefer <rpriefer at adelphi.edu>
>> To: fieldtrip at science.ru.nl
>> Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
>> Message-ID:
>>         <CAHto=
>> cjaw+-_NKHNMy4Rkp1YeeFu7dd6xjAq-iysH-yj2nB2cA at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hello,
>>
>> I work as a Lab Coordinator for the Neurocognition of Communication
>> Disorders Lab at Adelphi University, New York. We are looking to perform a
>> cluster-based permutation test on our EEG data but have some questions as
>> we are quite unfamiliar with how to apply it to this data in particular,
>> and neither of us are too familiar with Matlab code.
>>
>> We collect our EEG data using a 128-HydroCel Geodesic Sensor Net from
>> EGI/Philips, and therefore we have used NetStation to do most of our
>> processing in the past.
>>
>> We have attempted to utilize the bountiful tutorials FieldTrip provides on
>> their website and YouTube channel but to no avail. Specifically, we were
>> using this <https://pastebin.com/yskmVKAh> code alongside this
>> <https://vimeo.com/45658196> workshop video. We are simply not savvy
>> enough
>> with Matlab code, despite these resources, and would really appreciate if
>> someone could provide some clarity on the process. Even the tutorials seem
>> to assume the user is knowledgeable about Matlab code/certain, intricate
>> things about the data itself that we just are not.
>>
>> We get stuck quite early on, particularly because we don't know what
>> cfg.headerformat, cfg.dataformat, and cfg.eventformat would be for our
>> system, as this seems to specify for the neuroscan system :
>>
>>    1. cfg=[]; % empties the universally used cfg-structure
>>    2. cfg.dataset=data{1}; % which dataset? Useful if a for-loop is used
>>    3. cfg.trialdef.eventtype= '?'; % We don't know what events have
>> happened
>>    4. cfg.headerformat='ns_cnt32'; % Watch Out! With the neuroscan system,
>>    you have to set the bit-rate
>>    5. cfg.dataformat='ns_cnt32'; % Otherwise you'll have corrupt data
>>    6. cfg.eventformat='ns_cnt32';
>>
>>
>> Some additional questions:
>>
>> Do you suggest beginning with a raw file and doing all processing in
>> fieldtrip for the best results? As of now we have been using a combination
>> of EEGLAB and NetStation 5 to process the data. We are assuming and hoping
>> that all of this fieldtrip analysis could be one on a completely
>> processed,
>> averaged EEG file - but what file type works best? The default for EGI is
>> .mff, but we could use .raw, .mat, .txt, and so on as exports from the NS5
>> program..
>>
>> Please advise as to what to do, or what further information you'd like
>> from
>> us. I apologize for potentially a loaded, vague question. We are very new
>> to this type of analyzing (we usually use R/RStudio).
>>
>> Thank you,
>>
>> --
>> Ryan Priefer
>> Lab Technical Coordinator
>> Communication Sciences and Disorders
>> t: 516.877.6787
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200311/5224717e/attachment-0001.htm
>> >
>>
>>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>


-- 
Ryan Priefer
Lab Technical Coordinator
Communication Sciences and Disorders
t: 516.877.6787
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200313/4711f60a/attachment.htm>

From politzerahless at gmail.com  Sat Mar 14 14:12:28 2020
From: politzerahless at gmail.com (Stephen Politzer-Ahles)
Date: Sat, 14 Mar 2020 21:12:28 +0800
Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
In-Reply-To: <mailman.27.1584183602.30731.fieldtrip@science.ru.nl>
References: <mailman.27.1584183602.30731.fieldtrip@science.ru.nl>
Message-ID: <CAJT2k_8qxQihLKUyT3HuL5cY5XDdv8yk4DkR74pqAdFaP-=6Kg@mail.gmail.com>

I would recommend using the tutorials on the FieldTrip wiki instead (
http://www.fieldtriptoolbox.org/tutorial/); while I'm sure the tutorial you
linked is great, it's 8 years old so some things may have changed, and the
code there is for Neuroscan data. If you work through the tutorials on the
wiki you will find a lot of reference information about what the various
fields in each function mean, and within the tutorial there's not just
sample code but also explanations of what everything in the code is for.
For instance, in your case, I'm not sure you need to use the fields
headerformat/dataformat/eventformat at all (I haven't worked with EGI data,
but at least in my own data processing I've never had to use any of these
fields when running ft_definetrial).

>From the table of contents linked above, I think the bare minimum tutorials
you'll need to go through to get from raw data to cluster-based tests is
"Introduction to the FieldTrip toolbox", "Preprocessing - Trigger based
trial selection", "Preprocessing of EEG data and computing ERPs", and
"Cluster-based permutation tests on event related fields". My
recommendation would be to go through this entire sequence (and possibly
others if needed, such as artifact rejection) using the sample data
provided with the tutorial, since it's guaranteed to work, and then once
you've done that and have better sense of how things work it should be
easier to figure out how to adapt this for your own dataset. That will also
make it easier to figure out where the problems are coming up (for example,
based on your description so far, it sounds like your problem now isn't
actually with cluster-based permutation tests but with importing data).

Best,
Steve






> Good afternoon,
>
> According to the tutorial I was using (link provided in original message)
> this was at the very beginning of processing. So, in this case, we were
> using a raw .mff file that had no previous processing done. This tutorial
> ran in tandem with a video (link also provided prior) and so I attempted to
> follow the steps that way. Therefore - yes, the error we ran into was
> simply importing the data! This is our first issue in our overall goal of
> attempting to run a CBPT, so you are correct there. So our issue here is
> not fully understanding the information related to importing the data (as
> the example uses Neuroscan headers, etc. which are different from ours, of
> course).
>
> I appreciate the paper you shared. I will look into it and keep working on
> this. With our little knowledge of Matlab code, trying to figure out errors
> in the code provides its own challenges, so this is all new to us.
>
> Many thanks!
>
> On Thu, Mar 12, 2020 at 7:34 PM Stephen Politzer-Ahles <
> politzerahless at gmail.com> wrote:
>
> > Could you clarify what step of the processing this cfg code is for?
> > Processing data and eventually running a cluster-based permutation test
> > requires many steps, most of which have their own function, and each
> > function has its own cfg structure to go along with it (the cfg structure
> > is just a way of passing arguments to the function). The cfg you've put
> > here looks like it's related to importing the data, rather than part of
> > actually running the permutation test.
> >
> > To get started, I would recommend reading the paper by Maris & Oostenveld
> > (2007), which explains the logic and procedures for the test, and going
> > through the tutorial at
> > http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_timelock/;
> > that has the code you're going to need, and it comes with a dataset
> already
> > prepared, so you'll be able to go through the whole thing with the sample
> > data to see how it works before you try it on yours. Unfortunately, I
> don't
> > think there's any way around learning MATLAB code; to be able to run
> these
> > tests and know what you're doing (enough to avoid making mistakes, or to
> > notice if you do make a mistake) you will need at least basic familiarity
> > with MATLAB.
> >
> > As for your other questions:
> > --I don't think the results will differ as a function of whether you
> > import a raw file and process within fieldtrip, or whether you process
> > elsewhere and then import averages. Most of the processing is going to
> come
> > out the same wherever you do it (there are some minor differences in the
> > default settings of the filters used by Fieldtrip vs. those used by,
> e.g.,
> > EEGLAB). The bigger issue is what's easier. For me, I sometimes find it a
> > little difficult to import already-averaged data into fieldtrip (there
> > surely is a way to do it, but in my own pipeline I just hack it -- which
> > also requires a decent familiarity with MATLAB code and with the
> structure
> > of Fieldtrip objects). Personally I find it easier to just do the
> > preprocessing within Fieldtrip (YMMV, though, depending on how familiar
> you
> > are with Fieldtrip).
> > --As for the best data type for importing, I haven't worked with EGI so
> > I'm not familiar with any of these or how they work with Fieldtrip, but
> > there definitely are other people on the mailing list who will be; I'd
> > recommend sending this as a separate question on its own.
> >
> > ---
> > Stephen Politzer-Ahles
> > The Hong Kong Polytechnic University
> > Department of Chinese and Bilingual Studies
> > http://www.polyu.edu.hk/cbs/sjpolit/
> >
> >
> >
> >
> >> ----------------------------------------------------------------------
> >>
> >> Message: 1
> >> Date: Wed, 11 Mar 2020 09:50:52 -0400
> >> From: Ryan Priefer <rpriefer at adelphi.edu>
> >> To: fieldtrip at science.ru.nl
> >> Subject: [FieldTrip] Help with Cluster-Based Permutation Tests
> >> Message-ID:
> >>         <CAHto=
> >> cjaw+-_NKHNMy4Rkp1YeeFu7dd6xjAq-iysH-yj2nB2cA at mail.gmail.com>
> >> Content-Type: text/plain; charset="utf-8"
> >>
> >> Hello,
> >>
> >> I work as a Lab Coordinator for the Neurocognition of Communication
> >> Disorders Lab at Adelphi University, New York. We are looking to
> perform a
> >> cluster-based permutation test on our EEG data but have some questions
> as
> >> we are quite unfamiliar with how to apply it to this data in particular,
> >> and neither of us are too familiar with Matlab code.
> >>
> >> We collect our EEG data using a 128-HydroCel Geodesic Sensor Net from
> >> EGI/Philips, and therefore we have used NetStation to do most of our
> >> processing in the past.
> >>
> >> We have attempted to utilize the bountiful tutorials FieldTrip provides
> on
> >> their website and YouTube channel but to no avail. Specifically, we were
> >> using this <https://pastebin.com/yskmVKAh> code alongside this
> >> <https://vimeo.com/45658196> workshop video. We are simply not savvy
> >> enough
> >> with Matlab code, despite these resources, and would really appreciate
> if
> >> someone could provide some clarity on the process. Even the tutorials
> seem
> >> to assume the user is knowledgeable about Matlab code/certain, intricate
> >> things about the data itself that we just are not.
> >>
> >> We get stuck quite early on, particularly because we don't know what
> >> cfg.headerformat, cfg.dataformat, and cfg.eventformat would be for our
> >> system, as this seems to specify for the neuroscan system :
> >>
> >>    1. cfg=[]; % empties the universally used cfg-structure
> >>    2. cfg.dataset=data{1}; % which dataset? Useful if a for-loop is used
> >>    3. cfg.trialdef.eventtype= '?'; % We don't know what events have
> >> happened
> >>    4. cfg.headerformat='ns_cnt32'; % Watch Out! With the neuroscan
> system,
> >>    you have to set the bit-rate
> >>    5. cfg.dataformat='ns_cnt32'; % Otherwise you'll have corrupt data
> >>    6. cfg.eventformat='ns_cnt32';
> >>
> >>
> >> Some additional questions:
> >>
> >> Do you suggest beginning with a raw file and doing all processing in
> >> fieldtrip for the best results? As of now we have been using a
> combination
> >> of EEGLAB and NetStation 5 to process the data. We are assuming and
> hoping
> >> that all of this fieldtrip analysis could be one on a completely
> >> processed,
> >> averaged EEG file - but what file type works best? The default for EGI
> is
> >> .mff, but we could use .raw, .mat, .txt, and so on as exports from the
> NS5
> >> program..
> >>
> >> Please advise as to what to do, or what further information you'd like
> >> from
> >> us. I apologize for potentially a loaded, vague question. We are very
> new
> >> to this type of analyzing (we usually use R/RStudio).
> >>
> >> Thank you,
> >>
> >> --
> >> Ryan Priefer
> >> Lab Technical Coordinator
> >> Communication Sciences and Disorders
> >> t: 516.877.6787
> >> -------------- next part --------------
> >> An HTML attachment was scrubbed...
> >> URL: <
> >>
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200311/5224717e/attachment-0001.htm
> >> >
> >>
> >>
> > _______________________________________________
> > fieldtrip mailing list
> > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> > https://doi.org/10.1371/journal.pcbi.1002202
> >
>
>
> --
> Ryan Priefer
> Lab Technical Coordinator
> Communication Sciences and Disorders
> t: 516.877.6787
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200313/4711f60a/attachment-0001.htm
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> ------------------------------
>
> End of fieldtrip Digest, Vol 112, Issue 12
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200314/6cc872a1/attachment.htm>

From mattwint at iu.edu  Sat Mar 14 20:07:01 2020
From: mattwint at iu.edu (Winter, Matthew)
Date: Sat, 14 Mar 2020 19:07:01 +0000
Subject: [FieldTrip] Cifti Problem
Message-ID: <1584212820679.38708@iu.edu>

Hi,


I am trying to read in a cifti file from HCP-MEG data sets. I have been using the ft_read_cifti(pathway) command, but I keep getting the same error: invalid MEX-file.


I am very new to this and am trying to do a very basic connectivity analysis both for a class and to teach myself how to work with these formats. So, any advice on how to fix this error and any other future steps would be greatly appreciated.


Best,

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200314/b2353a8e/attachment.htm>

From jan.schoffelen at donders.ru.nl  Sun Mar 15 11:40:36 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Sun, 15 Mar 2020 10:40:36 +0000
Subject: [FieldTrip] Cifti Problem
In-Reply-To: <1584212820679.38708@iu.edu>
References: <1584212820679.38708@iu.edu>
Message-ID: <E3348925-AC71-4F8A-BF1F-99B5A5CDECC8@donders.ru.nl>

Hi Matt,

Could you be a bit more specific please? What is your operating system and matlab version?
What is the exact error message you get, i.e. which mex-file is invalid?

Jan-Mathijs


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



On 14 Mar 2020, at 20:07, Winter, Matthew <mattwint at iu.edu<mailto:mattwint at iu.edu>> wrote:

Hi,

I am trying to read in a cifti file from HCP-MEG data sets. I have been using the ft_read_cifti(pathway) command, but I keep getting the same error: invalid MEX-file.

I am very new to this and am trying to do a very basic connectivity analysis both for a class and to teach myself how to work with these formats. So, any advice on how to fix this error and any other future steps would be greatly appreciated.

Best,
Matt
_______________________________________________
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/20200315/9dca0a13/attachment.htm>

From mattwint at iu.edu  Sun Mar 15 20:06:45 2020
From: mattwint at iu.edu (Winter, Matthew)
Date: Sun, 15 Mar 2020 19:06:45 +0000
Subject: [FieldTrip] Cifti Problem
In-Reply-To: <E3348925-AC71-4F8A-BF1F-99B5A5CDECC8@donders.ru.nl>
References: <1584212820679.38708@iu.edu>,
 <E3348925-AC71-4F8A-BF1F-99B5A5CDECC8@donders.ru.nl>
Message-ID: <1584299203126.84502@iu.edu>

Hi Jan,


Thanks for getting back to me. I am working on a linux cluster for Indiana University. the matlab version is 2019. I am typing in:


>>ft_read_cifti('100307_MEG_Wrkmem_srcavglcmv_[LM-TIM-0B]_[IT-avg].power.dtseries.nii')


in response I get:

Invalid MEX-file '/geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/fileio/private/ft_getopt.mexa64':
/geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/fileio/private/ft_getopt.mexa64: undefined symbol: mxErrMsgTxt
Error in ft_read_cifti (line 58)
readdata         = ft_getopt(varargin, 'readdata', []);   % the default depends on file size, see below


I have tried re-configuring the MEX-files, as that was one suggestion, and it didn't change anything.

If you need more info, let me know and I will do my best to supply it.

Thank again, I really appreciate any advice.


Best,

Matt

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Sunday, March 15, 2020 6:40 AM
To: FieldTrip discussion list
Subject: [External] Re: [FieldTrip] Cifti Problem

This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.

Hi Matt,

Could you be a bit more specific please? What is your operating system and matlab version?
What is the exact error message you get, i.e. which mex-file is invalid?

Jan-Mathijs


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



On 14 Mar 2020, at 20:07, Winter, Matthew <mattwint at iu.edu<mailto:mattwint at iu.edu>> wrote:

Hi,

I am trying to read in a cifti file from HCP-MEG data sets. I have been using the ft_read_cifti(pathway) command, but I keep getting the same error: invalid MEX-file.

I am very new to this and am trying to do a very basic connectivity analysis both for a class and to teach myself how to work with these formats. So, any advice on how to fix this error and any other future steps would be greatly appreciated.

Best,
Matt
_______________________________________________
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/20200315/8c3e680c/attachment.htm>

From maran at cbs.mpg.de  Mon Mar 16 11:41:11 2020
From: maran at cbs.mpg.de (Matteo Maran)
Date: Mon, 16 Mar 2020 11:41:11 +0100 (CET)
Subject: [FieldTrip] Cluster-based permutation tests - indepedent variable
 with 3 levels
Message-ID: <240896332.165563.1584355271163.JavaMail.zimbra@cbs.mpg.de>

Dear Fieldtrip users,

I would like to ask you if it is possible to run the cluster-based permutation tests in a within-subject design where one independent variable has more than two levels (e.g. 3). I have a 3x2 within-subject design, with subjects doing a language task in three different settings (A, B and C, which were administered in three different sessions). Factor 1 refers to the setting (setting A, setting B, setting C) and factor 2 to a contrast within the language task (correct item, incorrect item). 

I have created 3 cells (all_setting_A, all_setting_B, all_setting_C) with, for each subject, the average of all the trials that were recorded respectively in the session with setting A, B and C. I then tried to run the cluster-based permutation test with the following code:

Nsub = length( all_setting_A);
cfg = [];
cfg.channel     = 'EEG';
cfg.latency     = [0 1];
cfg.avgovertime = 'no';
cfg.parameter   = 'avg';
cfg.method = 'montecarlo';
cfg.statistic = 'depsamplesT';
cfg.correctm = 'cluster';
cfg.clusteralpha = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan = 2;
cfg.neighbours = neighbours;  
cfg.tail = 0;
cfg.clustertail = 0;
cfg.alpha = 0.025;
cfg.numrandomization = 1000;
cfg.design(1,1:3*Nsub)  = [ones(1,Nsub) 2*ones(1,Nsub), 3*ones(1, Nsub)];
cfg.design(2,1:3*Nsub)  = [1:Nsub 1:Nsub 1:Nsub];
cfg.ivar                = 1; % the 1st row in cfg.design contains the independent variable
cfg.uvar                = 2; % the 2nd row in cfg.design contains the subject number
main_setting_stat = ft_timelockstatistics(cfg, all_setting_A{:}, all_setting_B{:}, all_setting_C{:});

I then get the following error:
- Error using ft_statfun_depsamplesT (line 79)
Invalid specification of the design array.
- Error using ft_statistics_montecarlo (line 244)
could not determine the parametric critical value for clustering
-Error in ft_timelockstatistics (line 184)
  [stat, cfg] = statmethod(cfg, dat, design);

If I check the line 79 of ft_statfun_depsamplesT, I see that the first error that I get (which then triggers the other two in ft_statistics_montercarlo and in ft_timelockstatistics) refers to this section:

% perform some checks on the design
sel1 = find(design(cfg.ivar,:)==1);
sel2 = find(design(cfg.ivar,:)==2);
n1  = length(sel1);
n2  = length(sel2);
if (n1+n2)<size(design,2) || (n1~=n2)
  ft_error('Invalid specification of the design array.');
end

The design check generates the error because, since I have a third level, the statement (n1+n2)<size(design,2) is true (n1+n2 would be equal to 2/3 of size(design,2)). Should I then assume that the maximum number of levels of a variable for cluster-based permutation tests is 2? Or is it sufficient to create a copy of ft_statfun_depsamplesT where I allow a third level:

% perform some checks on the design
sel1 = find(design(cfg.ivar,:)==1);
sel2 = find(design(cfg.ivar,:)==2);
sel3 = find(design(cfg.ivar,:)==3);
n1  = length(sel1);
n2  = length(sel2);
n3  = length(sel3);
if (n1+n2+n3)<size(design,2) || (n1~=n2~=n3)
  ft_error('Invalid specification of the design array.');
end

Since in principle by using difference waves it is possible to analyze any K-by-L factorial design (http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests/), I thought that it could be possible to analyze also a main effect with an independent variable with three levels. For example, with K = 3 and L = 2, a 3x2 interaction would be tested by comparing three difference waves.



Thank you for your help!

Best wishes,

Matteo Maran


From e.spaak at donders.ru.nl  Mon Mar 16 13:26:05 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Mon, 16 Mar 2020 13:26:05 +0100
Subject: [FieldTrip] Cluster-based permutation tests - indepedent
 variable with 3 levels
In-Reply-To: <240896332.165563.1584355271163.JavaMail.zimbra@cbs.mpg.de>
References: <240896332.165563.1584355271163.JavaMail.zimbra@cbs.mpg.de>
Message-ID: <CABPNLUp0YuSWWn6P-5ruCutT9vdgUMUb0jis3LPPHrxRfqFLMg@mail.gmail.com>

Dear Matteo,

You are on the right track I think, but are using 'depsamplesT' as a
statfun, which only supports 2 levels of the independent variable
(since it computes t-scores). Try the same with cfg.statistic =
'depsamplesF_univariate'  and I think it should work (using an F stat
to compare scores on more than 2 levels of the independent variable).

Best,
Eelke


On Mon, 16 Mar 2020 at 11:41, Matteo Maran <maran at cbs.mpg.de> wrote:
>
> Dear Fieldtrip users,
>
> I would like to ask you if it is possible to run the cluster-based permutation tests in a within-subject design where one independent variable has more than two levels (e.g. 3). I have a 3x2 within-subject design, with subjects doing a language task in three different settings (A, B and C, which were administered in three different sessions). Factor 1 refers to the setting (setting A, setting B, setting C) and factor 2 to a contrast within the language task (correct item, incorrect item).
>
> I have created 3 cells (all_setting_A, all_setting_B, all_setting_C) with, for each subject, the average of all the trials that were recorded respectively in the session with setting A, B and C. I then tried to run the cluster-based permutation test with the following code:
>
> Nsub = length( all_setting_A);
> cfg = [];
> cfg.channel     = 'EEG';
> cfg.latency     = [0 1];
> cfg.avgovertime = 'no';
> cfg.parameter   = 'avg';
> cfg.method = 'montecarlo';
> cfg.statistic = 'depsamplesT';
> cfg.correctm = 'cluster';
> cfg.clusteralpha = 0.05;
> cfg.clusterstatistic = 'maxsum';
> cfg.minnbchan = 2;
> cfg.neighbours = neighbours;
> cfg.tail = 0;
> cfg.clustertail = 0;
> cfg.alpha = 0.025;
> cfg.numrandomization = 1000;
> cfg.design(1,1:3*Nsub)  = [ones(1,Nsub) 2*ones(1,Nsub), 3*ones(1, Nsub)];
> cfg.design(2,1:3*Nsub)  = [1:Nsub 1:Nsub 1:Nsub];
> cfg.ivar                = 1; % the 1st row in cfg.design contains the independent variable
> cfg.uvar                = 2; % the 2nd row in cfg.design contains the subject number
> main_setting_stat = ft_timelockstatistics(cfg, all_setting_A{:}, all_setting_B{:}, all_setting_C{:});
>
> I then get the following error:
> - Error using ft_statfun_depsamplesT (line 79)
> Invalid specification of the design array.
> - Error using ft_statistics_montecarlo (line 244)
> could not determine the parametric critical value for clustering
> -Error in ft_timelockstatistics (line 184)
>   [stat, cfg] = statmethod(cfg, dat, design);
>
> If I check the line 79 of ft_statfun_depsamplesT, I see that the first error that I get (which then triggers the other two in ft_statistics_montercarlo and in ft_timelockstatistics) refers to this section:
>
> % perform some checks on the design
> sel1 = find(design(cfg.ivar,:)==1);
> sel2 = find(design(cfg.ivar,:)==2);
> n1  = length(sel1);
> n2  = length(sel2);
> if (n1+n2)<size(design,2) || (n1~=n2)
>   ft_error('Invalid specification of the design array.');
> end
>
> The design check generates the error because, since I have a third level, the statement (n1+n2)<size(design,2) is true (n1+n2 would be equal to 2/3 of size(design,2)). Should I then assume that the maximum number of levels of a variable for cluster-based permutation tests is 2? Or is it sufficient to create a copy of ft_statfun_depsamplesT where I allow a third level:
>
> % perform some checks on the design
> sel1 = find(design(cfg.ivar,:)==1);
> sel2 = find(design(cfg.ivar,:)==2);
> sel3 = find(design(cfg.ivar,:)==3);
> n1  = length(sel1);
> n2  = length(sel2);
> n3  = length(sel3);
> if (n1+n2+n3)<size(design,2) || (n1~=n2~=n3)
>   ft_error('Invalid specification of the design array.');
> end
>
> Since in principle by using difference waves it is possible to analyze any K-by-L factorial design (http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests/), I thought that it could be possible to analyze also a main effect with an independent variable with three levels. For example, with K = 3 and L = 2, a 3x2 interaction would be tested by comparing three difference waves.
>
>
>
> Thank you for your help!
>
> Best wishes,
>
> Matteo Maran
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202



From jan.schoffelen at donders.ru.nl  Mon Mar 16 14:49:36 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 16 Mar 2020 13:49:36 +0000
Subject: [FieldTrip] Cifti Problem a.k.a. ft_getopt.mexa64 problem
In-Reply-To: <1584299203126.84502@iu.edu>
References: <1584212820679.38708@iu.edu>
 <E3348925-AC71-4F8A-BF1F-99B5A5CDECC8@donders.ru.nl>
 <1584299203126.84502@iu.edu>
Message-ID: <44E6CD0D-4193-4CF1-B933-033C0A0EDECA@donders.ru.nl>

Hi Matt,

Strange, typically the mex-files under linux behave relatively well.

Are you sure that everything went well, when you recompiled the mex files? The mex-files exist at various locations in the toolbox, for instance, ft_getopt is not only located in fileio/private, but als in private utilities/private forward/private etc.
It could be that you re-compiled something, but that the latest version of the compilation did not end up at the right location.

Also, you could try and delete the *.mexa64 version of the file from the location where it causes problems. This leads to fieldtrip falling back to the slower (but hopefully still functional) version of ft_getopt.m

Best wishes,
Jan-Mathijs



On 15 Mar 2020, at 20:06, Winter, Matthew <mattwint at iu.edu<mailto:mattwint at iu.edu>> wrote:

Hi Jan,

Thanks for getting back to me. I am working on a linux cluster for Indiana University. the matlab version is 2019. I am typing in:

>>ft_read_cifti('100307_MEG_Wrkmem_srcavglcmv_[LM-TIM-0B]_[IT-avg].power.dtseries.nii')

in response I get:

Invalid MEX-file '/geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/fileio/private/ft_getopt.mexa64':
/geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/fileio/private/ft_getopt.mexa64: undefined symbol: mxErrMsgTxt
Error in ft_read_cifti (line 58)
readdata         = ft_getopt(varargin, 'readdata', []);   % the default depends on file size, see below

I have tried re-configuring the MEX-files, as that was one suggestion, and it didn't change anything.
If you need more info, let me know and I will do my best to supply it.
Thank again, I really appreciate any advice.

Best,
Matt
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Sunday, March 15, 2020 6:40 AM
To: FieldTrip discussion list
Subject: [External] Re: [FieldTrip] Cifti Problem

This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.

Hi Matt,

Could you be a bit more specific please? What is your operating system and matlab version?
What is the exact error message you get, i.e. which mex-file is invalid?

Jan-Mathijs


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



On 14 Mar 2020, at 20:07, Winter, Matthew <mattwint at iu.edu<mailto:mattwint at iu.edu>> wrote:

Hi,

I am trying to read in a cifti file from HCP-MEG data sets. I have been using the ft_read_cifti(pathway) command, but I keep getting the same error: invalid MEX-file.

I am very new to this and am trying to do a very basic connectivity analysis both for a class and to teach myself how to work with these formats. So, any advice on how to fix this error and any other future steps would be greatly appreciated.

Best,
Matt
_______________________________________________
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200316/c3425825/attachment.htm>

From maran at cbs.mpg.de  Mon Mar 16 17:53:04 2020
From: maran at cbs.mpg.de (Matteo Maran)
Date: Mon, 16 Mar 2020 17:53:04 +0100 (CET)
Subject: [FieldTrip] Cluster-based permutation tests - indepedent
 variable with 3 levels
In-Reply-To: <CABPNLUp0YuSWWn6P-5ruCutT9vdgUMUb0jis3LPPHrxRfqFLMg@mail.gmail.com>
References: <240896332.165563.1584355271163.JavaMail.zimbra@cbs.mpg.de>
 <CABPNLUp0YuSWWn6P-5ruCutT9vdgUMUb0jis3LPPHrxRfqFLMg@mail.gmail.com>
Message-ID: <1813303539.317853.1584377584931.JavaMail.zimbra@cbs.mpg.de>

Dear Eelke,

thank you very much, it worked!

Bests,

Matteo Maran

----- Original Message -----
From: "Eelke Spaak" <e.spaak at donders.ru.nl>
To: "fieldtrip" <fieldtrip at science.ru.nl>
Sent: Monday, March 16, 2020 1:26:05 PM
Subject: Re: [FieldTrip] Cluster-based permutation tests - indepedent variable with 3 levels

Dear Matteo,

You are on the right track I think, but are using 'depsamplesT' as a
statfun, which only supports 2 levels of the independent variable
(since it computes t-scores). Try the same with cfg.statistic =
'depsamplesF_univariate'  and I think it should work (using an F stat
to compare scores on more than 2 levels of the independent variable).

Best,
Eelke


On Mon, 16 Mar 2020 at 11:41, Matteo Maran <maran at cbs.mpg.de> wrote:
>
> Dear Fieldtrip users,
>
> I would like to ask you if it is possible to run the cluster-based permutation tests in a within-subject design where one independent variable has more than two levels (e.g. 3). I have a 3x2 within-subject design, with subjects doing a language task in three different settings (A, B and C, which were administered in three different sessions). Factor 1 refers to the setting (setting A, setting B, setting C) and factor 2 to a contrast within the language task (correct item, incorrect item).
>
> I have created 3 cells (all_setting_A, all_setting_B, all_setting_C) with, for each subject, the average of all the trials that were recorded respectively in the session with setting A, B and C. I then tried to run the cluster-based permutation test with the following code:
>
> Nsub = length( all_setting_A);
> cfg = [];
> cfg.channel     = 'EEG';
> cfg.latency     = [0 1];
> cfg.avgovertime = 'no';
> cfg.parameter   = 'avg';
> cfg.method = 'montecarlo';
> cfg.statistic = 'depsamplesT';
> cfg.correctm = 'cluster';
> cfg.clusteralpha = 0.05;
> cfg.clusterstatistic = 'maxsum';
> cfg.minnbchan = 2;
> cfg.neighbours = neighbours;
> cfg.tail = 0;
> cfg.clustertail = 0;
> cfg.alpha = 0.025;
> cfg.numrandomization = 1000;
> cfg.design(1,1:3*Nsub)  = [ones(1,Nsub) 2*ones(1,Nsub), 3*ones(1, Nsub)];
> cfg.design(2,1:3*Nsub)  = [1:Nsub 1:Nsub 1:Nsub];
> cfg.ivar                = 1; % the 1st row in cfg.design contains the independent variable
> cfg.uvar                = 2; % the 2nd row in cfg.design contains the subject number
> main_setting_stat = ft_timelockstatistics(cfg, all_setting_A{:}, all_setting_B{:}, all_setting_C{:});
>
> I then get the following error:
> - Error using ft_statfun_depsamplesT (line 79)
> Invalid specification of the design array.
> - Error using ft_statistics_montecarlo (line 244)
> could not determine the parametric critical value for clustering
> -Error in ft_timelockstatistics (line 184)
>   [stat, cfg] = statmethod(cfg, dat, design);
>
> If I check the line 79 of ft_statfun_depsamplesT, I see that the first error that I get (which then triggers the other two in ft_statistics_montercarlo and in ft_timelockstatistics) refers to this section:
>
> % perform some checks on the design
> sel1 = find(design(cfg.ivar,:)==1);
> sel2 = find(design(cfg.ivar,:)==2);
> n1  = length(sel1);
> n2  = length(sel2);
> if (n1+n2)<size(design,2) || (n1~=n2)
>   ft_error('Invalid specification of the design array.');
> end
>
> The design check generates the error because, since I have a third level, the statement (n1+n2)<size(design,2) is true (n1+n2 would be equal to 2/3 of size(design,2)). Should I then assume that the maximum number of levels of a variable for cluster-based permutation tests is 2? Or is it sufficient to create a copy of ft_statfun_depsamplesT where I allow a third level:
>
> % perform some checks on the design
> sel1 = find(design(cfg.ivar,:)==1);
> sel2 = find(design(cfg.ivar,:)==2);
> sel3 = find(design(cfg.ivar,:)==3);
> n1  = length(sel1);
> n2  = length(sel2);
> n3  = length(sel3);
> if (n1+n2+n3)<size(design,2) || (n1~=n2~=n3)
>   ft_error('Invalid specification of the design array.');
> end
>
> Since in principle by using difference waves it is possible to analyze any K-by-L factorial design (http://www.fieldtriptoolbox.org/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests/), I thought that it could be possible to analyze also a main effect with an independent variable with three levels. For example, with K = 3 and L = 2, a 3x2 interaction would be tested by comparing three difference waves.
>
>
>
> Thank you for your help!
>
> Best wishes,
>
> Matteo Maran
> _______________________________________________
> 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


From mattwint at iu.edu  Mon Mar 16 18:36:34 2020
From: mattwint at iu.edu (Winter, Matthew)
Date: Mon, 16 Mar 2020 17:36:34 +0000
Subject: [FieldTrip] Cifti Problem a.k.a. ft_getopt.mexa64 problem
In-Reply-To: <44E6CD0D-4193-4CF1-B933-033C0A0EDECA@donders.ru.nl>
References: <1584212820679.38708@iu.edu>
 <E3348925-AC71-4F8A-BF1F-99B5A5CDECC8@donders.ru.nl>
 <1584299203126.84502@iu.edu>,
 <44E6CD0D-4193-4CF1-B933-033C0A0EDECA@donders.ru.nl>
Message-ID: <1584380195148.11251@iu.edu>

I did get the same message before and after recompiling so it didn't seem to do anything.

I did try and get rid of the .mexa64 but now I get:



Warning: adding /geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/external/gifti toolbox to your MATLAB path
Array indices must be positive integers or logical values.

Error in xml_parser>tag_element (line 227)
        xtree{Xparse_count} = element;

Error in xml_parser>compile (line 199)
                            frag = tag_element(frag);

Error in xml_parser (line 134)
tree = compile(tree);

Error in xmltree (line 41)
                tree.tree = xml_parser(varargin{1});

Error in ft_read_cifti (line 136)
tree = xmltree(xmldata);
 ​


________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Monday, March 16, 2020 9:49 AM
To: FieldTrip discussion list
Subject: [External] Re: [FieldTrip] Cifti Problem a.k.a. ft_getopt.mexa64 problem

This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.

Hi Matt,

Strange, typically the mex-files under linux behave relatively well.

Are you sure that everything went well, when you recompiled the mex files? The mex-files exist at various locations in the toolbox, for instance, ft_getopt is not only located in fileio/private, but als in private utilities/private forward/private etc.
It could be that you re-compiled something, but that the latest version of the compilation did not end up at the right location.

Also, you could try and delete the *.mexa64 version of the file from the location where it causes problems. This leads to fieldtrip falling back to the slower (but hopefully still functional) version of ft_getopt.m

Best wishes,
Jan-Mathijs



On 15 Mar 2020, at 20:06, Winter, Matthew <mattwint at iu.edu<mailto:mattwint at iu.edu>> wrote:

Hi Jan,

Thanks for getting back to me. I am working on a linux cluster for Indiana University. the matlab version is 2019. I am typing in:

>>ft_read_cifti('100307_MEG_Wrkmem_srcavglcmv_[LM-TIM-0B]_[IT-avg].power.dtseries.nii')

in response I get:

Invalid MEX-file '/geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/fileio/private/ft_getopt.mexa64':
/geode2/home/u060/mattwint/Carbonate/fieldtrip-r10442/fileio/private/ft_getopt.mexa64: undefined symbol: mxErrMsgTxt
Error in ft_read_cifti (line 58)
readdata         = ft_getopt(varargin, 'readdata', []);   % the default depends on file size, see below

I have tried re-configuring the MEX-files, as that was one suggestion, and it didn't change anything.
If you need more info, let me know and I will do my best to supply it.
Thank again, I really appreciate any advice.

Best,
Matt
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Sent: Sunday, March 15, 2020 6:40 AM
To: FieldTrip discussion list
Subject: [External] Re: [FieldTrip] Cifti Problem

This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.

Hi Matt,

Could you be a bit more specific please? What is your operating system and matlab version?
What is the exact error message you get, i.e. which mex-file is invalid?

Jan-Mathijs


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



On 14 Mar 2020, at 20:07, Winter, Matthew <mattwint at iu.edu<mailto:mattwint at iu.edu>> wrote:

Hi,

I am trying to read in a cifti file from HCP-MEG data sets. I have been using the ft_read_cifti(pathway) command, but I keep getting the same error: invalid MEX-file.

I am very new to this and am trying to do a very basic connectivity analysis both for a class and to teach myself how to work with these formats. So, any advice on how to fix this error and any other future steps would be greatly appreciated.

Best,
Matt
_______________________________________________
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200316/eb335485/attachment.htm>

From Johannes.Lang at uk-erlangen.de  Tue Mar 17 00:38:41 2020
From: Johannes.Lang at uk-erlangen.de (Lang, Johannes)
Date: Mon, 16 Mar 2020 23:38:41 +0000
Subject: [FieldTrip] Problem with ft_preprocessing and printor function
Message-ID: <01cc90ff6a304311989c2d48b746e313@uk-erlangen.de>

Hello there!

I'm pretty new to fieldtrip and recently ran into a problem that I don't know how to solve:
When calling the ft_preproc function I keep getting this message:

Undefined function 'printor' for input arguments of type 'cell'.

Error in ft_checkdata (line 521)
    typestr = printor(dtype, true);

Error in ft_preprocessing (line 281)
  data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'hassampleinfo', 'yes');

Error in draft_1_3 (line 34)
[C3_temp] = ft_preprocessing(cfg, 'C3_.ncs');

I read the files using the ft_read_data('myfile.ncs')
Which returns a double.
Does anyone know what I'm doing wrong?

Thanks!
jd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200316/4cecb653/attachment.htm>

From r.oostenveld at donders.ru.nl  Tue Mar 17 09:36:32 2020
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Tue, 17 Mar 2020 09:36:32 +0100
Subject: [FieldTrip] Beamforming  sources (lecture)
In-Reply-To: <F11F6C16-0285-4319-896B-E2A7A95FAD17@vu.nl>
References: <F11F6C16-0285-4319-896B-E2A7A95FAD17@vu.nl>
Message-ID: <BE16AFC7-8315-47B3-A3AB-24616D8BDAB3@donders.ru.nl>

Hi Marzieh

Let me CC this email to the mailing list (see http://www.fieldtriptoolbox.org/discussion_list/ <http://www.fieldtriptoolbox.org/discussion_list/>), since people there might have more advice for you.

I don’t have specific lectures on source reconstruction in childrens data. All available online lectuires are here http://www.fieldtriptoolbox.org/video/ <http://www.fieldtriptoolbox.org/video/> and here https://www.youtube.com/fieldtriptoolbox <https://www.youtube.com/fieldtriptoolbox>

It is a question I am more often asked. Important for EEG source reconstruction in general is to have a good (at least a decent) volume conduction model and to have proper electrode positions. Otherwise the forward `model (see lecture on that) won’t match the data and the reconstruction will be bad or fail. See for example http://www.fieldtriptoolbox.org/tutorial/electrode/ <http://www.fieldtriptoolbox.org/tutorial/electrode/> as a method to acquire electrode positions, but also http://www.fieldtriptoolbox.org/faq/structuresensor/ <http://www.fieldtriptoolbox.org/faq/structuresensor/>

Also look at https://www.pedeheadmod.net <https://www.pedeheadmod.net/> for children head models. It would be nice if someone would write documentation on how to use those head models with FieldTrip.

best
Robert

 


> On 16 Mar 2020, at 20:18, Borhanazad, M. <m.borhanazad at vu.nl> wrote:
> 
> Dear Robert,
> 
> I’m Marzieh, […] and I’m working on children's data and we want to apply the beamforming on the data. 
> 
> I’ve been reading and watching lots of sources about the beamforming and mathematics behind it to correctly implement the beamforming on my data. However, none of them were satisfying for me. 
> 
> I want to know what are the important parameters and how can I change it (to what extend) and what is the best technique to use, etc. 
> 
> I would like to ask you if you have any lecture with these details that I can attend (probably after Corona attack) or if you know a good source that can help me with that.
> 
> Thanks a lot!
> 
> Best regards,
> Marzieh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200317/0398f4af/attachment.htm>

From jan.schoffelen at donders.ru.nl  Tue Mar 17 09:45:12 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 17 Mar 2020 08:45:12 +0000
Subject: [FieldTrip] Problem with ft_preprocessing and printor function
In-Reply-To: <01cc90ff6a304311989c2d48b746e313@uk-erlangen.de>
References: <01cc90ff6a304311989c2d48b746e313@uk-erlangen.de>
Message-ID: <399C6D1A-020E-48C6-8E80-ACC3D1814975@donders.ru.nl>

Hi Johannes,

I recommend you to read a bit on the website about how to read in data in general, and to consult in more detail the getting started sections:

http://www.fieldtriptoolbox.org/getting_started/neuralynx_fcdc/
http://www.fieldtriptoolbox.org/getting_started/neuralynx/

The syntax you used for ft_preprocessing is incorrect, since the second input argument is never a filename.
Also, I suggest to stick, wherever possible to the high-level functions, i.e. ft_preprocessing, rather than ft_read_data, or preproc.

Best wishes,
Jan-Mathijs



On 17 Mar 2020, at 00:38, Lang, Johannes <Johannes.Lang at uk-erlangen.de<mailto:Johannes.Lang at uk-erlangen.de>> wrote:

Hello there!

I’m pretty new to fieldtrip and recently ran into a problem that I don‘t know how to solve:
When calling the ft_preproc function I keep getting this message:

Undefined function 'printor' for input arguments of type 'cell'.

Error in ft_checkdata (line 521)
    typestr = printor(dtype, true);

Error in ft_preprocessing (line 281)
  data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'hassampleinfo', 'yes');

Error in draft_1_3 (line 34)
[C3_temp] = ft_preprocessing(cfg, 'C3_.ncs');

I read the files using the ft_read_data(‘myfile.ncs’)
Which returns a double.
Does anyone know what I’m doing wrong?

Thanks!
jd
_______________________________________________
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/20200317/23d000dc/attachment.htm>

From kprinslo at UR.Rochester.edu  Thu Mar 19 22:17:40 2020
From: kprinslo at UR.Rochester.edu (Prinsloo, Kevin)
Date: Thu, 19 Mar 2020 21:17:40 +0000
Subject: [FieldTrip] Combining different channel montages
Message-ID: <MN2PR07MB6255F7749FB11523710ADC2BF4F40@MN2PR07MB6255.namprd07.prod.outlook.com>

Dear Fiedltrippers

Apologies for reposting if this has been discussed.

Trying to find the best solution to combine different EEG channel montages from Biosemi.
i.e. I'd like to combine different datasets that have different channel numbers 256, 128 and 64 channel numbers into a common space/montage.
Currently my thoughts are to do some manual sorting across similar electrodes and or use spline interpolation but not sure of the simplest and best plan.

I've seen this tutorial but was wondering if there are any other suggestions from anyone else who has done this.
http://www.fieldtriptoolbox.org/tutorial/layout/

Best
Kevin

Kevin Prinsloo
Postdoctoral Research Associate
Biomedical Engineering
University of Rochester
Rochester, New York

E: kprinslo at ur.rochester.edu<mailto:kprinslo at ur.rochester.edu>
T: https://twitter.com/KevinD_P

https://www.urmc.rochester.edu/labs/lalor-lab.aspx
http://lalorlab.net/<https://urldefense.proofpoint.com/v2/url?u=http-3A__lalorlab.net_&d=DwMFaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=cTmY4wEbip0J0YpXWTvco8EmwoWTk2aEkcafjODdsd8&m=Hyrd8hbwwj6cauUc5wiOdWaGRiflIzet3QKLe0_5pAA&s=5YynwwyBkuhROz0YOesk-kMDn8lSWPiTeIp-yc4CZ5w&e=>
https://www.urmc.rochester.edu/labs/cognitive-neurophysiology.aspx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200319/e12970b4/attachment.htm>

From politzerahless at gmail.com  Fri Mar 20 09:08:33 2020
From: politzerahless at gmail.com (Stephen Politzer-Ahles)
Date: Fri, 20 Mar 2020 16:08:33 +0800
Subject: [FieldTrip] Line styles not working in ft_multiplotER?
Message-ID: <CAJT2k_9YgLVxjSmR=A4fUF0BY4Sq0TKYQf7bo4Vb42nfGNU1Gw@mail.gmail.com>

Hi all,

I am trying to plot two ERPs in ft_multiplotER with different line styles.
According to the documentation, I should be able to feed a cell array of
styles into cfg.linestyle. But when I do that, it seems to only use the
last style in the cell array. Here's an example of the code I'm using:

figure;
cfg = [];
cfg.parameter = 'avg';
cfg.layout = lay;
cfg.showlabels= 'yes';
cfg.linestyle = {'-' '--'};
cfg.channel = {'EEG' '-M1' '-M2'};
ft_multiplotER( cfg, MMNsonly.ka3, MMNsonly.pa3 );

I expected that this should make one of the ERPs be a solid line and one a
dashed line, but it made both of them dashed lines, as you can see here:
https://imgur.com/a/RybbkLq

I'm not sure if I'm missing something that I should be doing, or if this is
a bug. If anyone needs to be able to reproduce this, let me know and I can
try to Dropbox you my data and layout to allow you to run this code.

Thanks,
Steve

---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.polyu.edu.hk/cbs/sjpolit/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200320/959950fc/attachment.htm>

From jan.schoffelen at donders.ru.nl  Fri Mar 20 09:22:17 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 20 Mar 2020 08:22:17 +0000
Subject: [FieldTrip] Line styles not working in ft_multiplotER?
In-Reply-To: <CAJT2k_9YgLVxjSmR=A4fUF0BY4Sq0TKYQf7bo4Vb42nfGNU1Gw@mail.gmail.com>
References: <CAJT2k_9YgLVxjSmR=A4fUF0BY4Sq0TKYQf7bo4Vb42nfGNU1Gw@mail.gmail.com>
Message-ID: <0966700F-6F44-40CB-A2E5-633C57DF0D85@donders.ru.nl>

Dear Steve,

Thanks for reporting this. Given the current global circumstances I started ’spring cleaning’ the open issues on github, which slipped off the radar before, due to more urgent matters.

As it is, I encountered an issue submitted about a year ago, which reported the same thing. The suggested fix has never come through, but the person reporting the original issue mentioned that it seemed to work on their end these days. Hence I closed the issue. I reopened it again (issue #928 on https://github.com/fieldtrip/fieldtrip/issues/928<http://github.com/fieldtrip/fieldtrip>). Feel free to sign up there and chime in with additional insights, suggestions for a fix etc.

Best wishes,

Jan-Mathijs




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




On 20 Mar 2020, at 09:08, Stephen Politzer-Ahles <politzerahless at gmail.com<mailto:politzerahless at gmail.com>> wrote:

I am trying to plot two ERPs in ft_multiplotER with different line styles. According to the documentation, I should be able to feed a cell array of styles into cfg.linestyle. But when I do that, it seems to only use the last style in the cell array. Here's an example of the code I'm using:

figure;
cfg = [];
cfg.parameter = 'avg';
cfg.layout = lay;
cfg.showlabels= 'yes';
cfg.linestyle = {'-' '--'};
cfg.channel = {'EEG' '-M1' '-M2'};
ft_multiplotER( cfg, MMNsonly.ka3, MMNsonly.pa3 );

I expected that this should make one of the ERPs be a solid line and one a dashed line, but it made both of them dashed lines, as you can see here: https://imgur.com/a/RybbkLq

I'm not sure if I'm missing something that I should be doing, or if this is a bug. If anyone needs to be able to reproduce this, let me know and I can try to Dropbox you my data and layout to allow you to run this code.

Thanks,
Steve



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200320/f2c15d00/attachment.htm>

From jan.schoffelen at donders.ru.nl  Fri Mar 20 09:27:36 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Fri, 20 Mar 2020 08:27:36 +0000
Subject: [FieldTrip] Line styles not working in ft_multiplotER?
In-Reply-To: <CAJT2k_9YgLVxjSmR=A4fUF0BY4Sq0TKYQf7bo4Vb42nfGNU1Gw@mail.gmail.com>
References: <CAJT2k_9YgLVxjSmR=A4fUF0BY4Sq0TKYQf7bo4Vb42nfGNU1Gw@mail.gmail.com>
Message-ID: <5465DDFF-32C6-499B-B927-A6280072B252@donders.ru.nl>

Hi Steve and all,

Sorry, I didn’t think this through well enough: it could be that your fieldtrip version is ’too old’. Could you upgrade to something much more recent and first check whether your problem persists?

Best wishes,
Jan-Mathijs


On 20 Mar 2020, at 09:08, Stephen Politzer-Ahles <politzerahless at gmail.com<mailto:politzerahless at gmail.com>> wrote:

Hi all,

I am trying to plot two ERPs in ft_multiplotER with different line styles. According to the documentation, I should be able to feed a cell array of styles into cfg.linestyle. But when I do that, it seems to only use the last style in the cell array. Here's an example of the code I'm using:

figure;
cfg = [];
cfg.parameter = 'avg';
cfg.layout = lay;
cfg.showlabels= 'yes';
cfg.linestyle = {'-' '--'};
cfg.channel = {'EEG' '-M1' '-M2'};
ft_multiplotER( cfg, MMNsonly.ka3, MMNsonly.pa3 );

I expected that this should make one of the ERPs be a solid line and one a dashed line, but it made both of them dashed lines, as you can see here: https://imgur.com/a/RybbkLq

I'm not sure if I'm missing something that I should be doing, or if this is a bug. If anyone needs to be able to reproduce this, let me know and I can try to Dropbox you my data and layout to allow you to run this code.

Thanks,
Steve

---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.polyu.edu.hk/cbs/sjpolit/
_______________________________________________
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/20200320/a1662b25/attachment.htm>

From politzerahless at gmail.com  Sun Mar 22 20:32:05 2020
From: politzerahless at gmail.com (Stephen Politzer-Ahles)
Date: Mon, 23 Mar 2020 03:32:05 +0800
Subject: [FieldTrip] Line styles not working in ft_multiplotER?
In-Reply-To: <mailman.27.1584702002.31748.fieldtrip@science.ru.nl>
References: <mailman.27.1584702002.31748.fieldtrip@science.ru.nl>
Message-ID: <CAJT2k_-R=OudR-F9ALLgys=8CC5F_3vjLSSmggQ2_iJKybV=aA@mail.gmail.com>

Ah yes, that took care of it -- I was using a 2016 release, when I
downloaded the latest release the different line styles worked as intended.
Thanks!

---
Stephen Politzer-Ahles
The Hong Kong Polytechnic University
Department of Chinese and Bilingual Studies
http://www.polyu.edu.hk/cbs/sjpolit/



> Message: 4
> Date: Fri, 20 Mar 2020 08:27:36 +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] Line styles not working in ft_multiplotER?
> Message-ID: <5465DDFF-32C6-499B-B927-A6280072B252 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Steve and all,
>
> Sorry, I didn’t think this through well enough: it could be that your
> fieldtrip version is ’too old’. Could you upgrade to something much more
> recent and first check whether your problem persists?
>
> Best wishes,
> Jan-Mathijs
>
>
> On 20 Mar 2020, at 09:08, Stephen Politzer-Ahles <politzerahless at gmail.com
> <mailto:politzerahless at gmail.com>> wrote:
>
> Hi all,
>
> I am trying to plot two ERPs in ft_multiplotER with different line styles.
> According to the documentation, I should be able to feed a cell array of
> styles into cfg.linestyle. But when I do that, it seems to only use the
> last style in the cell array. Here's an example of the code I'm using:
>
> figure;
> cfg = [];
> cfg.parameter = 'avg';
> cfg.layout = lay;
> cfg.showlabels= 'yes';
> cfg.linestyle = {'-' '--'};
> cfg.channel = {'EEG' '-M1' '-M2'};
> ft_multiplotER( cfg, MMNsonly.ka3, MMNsonly.pa3 );
>
> I expected that this should make one of the ERPs be a solid line and one a
> dashed line, but it made both of them dashed lines, as you can see here:
> https://imgur.com/a/RybbkLq
>
> I'm not sure if I'm missing something that I should be doing, or if this
> is a bug. If anyone needs to be able to reproduce this, let me know and I
> can try to Dropbox you my data and layout to allow you to run this code.
>
> Thanks,
> Steve
>
> ---
> Stephen Politzer-Ahles
> The Hong Kong Polytechnic University
> Department of Chinese and Bilingual Studies
> http://www.polyu.edu.hk/cbs/sjpolit/
> _______________________________________________
> 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/20200323/269f8b47/attachment.htm>

From ecaspar at ulb.ac.be  Mon Mar 23 17:35:02 2020
From: ecaspar at ulb.ac.be (Emilie Caspar)
Date: Mon, 23 Mar 2020 17:35:02 +0100
Subject: [FieldTrip] Source reconstruction - biosemi 64
Message-ID: <06256EB2-261C-4FE3-8BE1-21F224F9F13F@ulb.ac.be>

Dear all, 

I am trying to perform a source reconstruction on EEG data acquired with a Biosemi system with 64 electrodes. I am experiencing two issues at the moment, one associated to whether or not my source_model is correct (see figure in attachement) or not and the second one is a mistake associated with the code.

Here is the code I am using:

% cfg=[];
% cfg.layout='biosemi64.lay';
% d=ft_prepare_layout(cfg);
% 
% q=struct2cell(d);
% 
% zeroline = 92/40*50;
% 
% q{65,1} = 'nasion';
% q{65,2} = zeroline; %ten percent under FPz
% q{65,3} = q{33,3};
% 
% q{66,1} = 'inion';
% q{66,2} = zeroline; %ten percent under Oz
% q{66,3} = q{29,3};
% 
% q{67,1} = 'left';
% q{67,2} = -zeroline; %ten percent under T7
% q{67,3} = q{15,3};
% 
% q{67,1} = 'right';
% q{67,2} = zeroline; %ten percent under T8
% q{67,3} = q{52,3};

q=biosim64;
ph = table2array(q(:,2));
th = table2array(q(:,3));
 
x = sin(ph*pi/180) .* cos(th*pi/180);
y = sin(ph*pi/180) .* sin(th*pi/180);
z = cos(ph*pi/180);
 
plot3(x, y, z, '.');
elec.label = q(:,1);
elec.pnt = [x y z];
 
cfg.sourcemodel.pos = elec.pnt;
sourcemodel = ft_prepare_sourcemodel(cfg);
 
vol = ft_read_headmodel('headmodel/standard_bem.mat');
 
% realign electrodes to headmodel
cfg = [];
cfg.method = 'interactive';
cfg.elec = elec;
cfg.headshape = vol.bnd(1); %1 = skin
elec = ft_electroderealign(cfg);
 
%save new electrodes
save elec64.mat elec

When I run the plot of the source model, it gives the output in attachement. But I really have no cue whether or not it sounds correct since this is the first time I am running this.

Then, we I run the ft_electroderealign, I have the following error message:
Error using table/length (line 419)
Undefined function 'length' for input arguments of type 'table'.  Use the HEIGHT, WIDTH,
or SIZE functions instead.

Do you have an easy solution to solve this? I could of course change the code in the ft_electroderealign but it’s probably not a good idea.


((((((((((other option:

I also tried to run it differently with what is in green (commented) based on an another example that I have found online (see http://www.fieldtriptoolbox.org/example/biosemi/#modify-layout-file <http://www.fieldtriptoolbox.org/example/biosemi/#modify-layout-file>). 
If I just use the same example it first lead to a mistake saying that Cell contents assignment to a non-cell array object. while it is exactly what is mentioned online. 
If I use a struct2cell q=struct2cell(d);, then I have the following error message Index exceeds matrix dimensions.))))))))))))

I am thus stuck with several different mistakes and since I have no one around who did this before, I am a bit lost on what to do and if what I am currently doing is correct.
Thank you in advance!
Emilie




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/be4f85f8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d'e?cran 2020-03-23 17.17.18.png
Type: image/png
Size: 132106 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/be4f85f8/attachment.png>

From amira.korkor at gmail.com  Mon Mar 23 18:41:29 2020
From: amira.korkor at gmail.com (Amira Korkor)
Date: Mon, 23 Mar 2020 17:41:29 +0000
Subject: [FieldTrip] Problem with timelockanalysis
Message-ID: <CAB8HUkXAsL9MjNorLYH628jn9c0mUEkaHzJJ4JxeDcE5uRZv6w@mail.gmail.com>

Hello,
I am new to Fieldtrip and this forum so please feel free to let me know if
the information I'm providing is sufficient to answer my question. I'm
having trouble with the timelockanalysis function as below. Does anyone
know why this might be happening?
Thanks for your help,
Amira

I'm running the following script in MATLAB_R2018b / fieldtrip-20181231. I
have tried running it on multiple older versions of Fieldtrip and gotten
similar errors:
*ERP(cond_i).erps(part_i) = ft_timelockanalysis (cfg, EEG_ft);*

and receiving the following error:










*Error using tabular/reshape (line 194)Undefined function 'reshape' for
input arguments of type 'table'.Error in ft_selectdata>squeezedim (line
1220)  x = reshape(x, [siz(~dim) 1]);Error in ft_selectdata (line 381)
varargin{i}.(datfield{j}) = squeezedim(varargin{i}.(datfield{j}),
~keepdim);Error in ft_timelockanalysis (line 195)data   =
ft_selectdata(tmpcfg, data);*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/df3d8039/attachment.htm>

From rpriefer at adelphi.edu  Mon Mar 23 19:44:31 2020
From: rpriefer at adelphi.edu (Ryan Priefer)
Date: Mon, 23 Mar 2020 14:44:31 -0400
Subject: [FieldTrip] ft_definetrial errors
Message-ID: <CAHto=cha1mXKErctRDJOOAO_u3V5SiwtdvEUmLHTQ_vH0EhSMQ@mail.gmail.com>

I was just working through the scripts you sent (thank you sooo much. Just
having it all together like this is already bounds better than where I was
before). That said I have already run into some issues since my experience
with MATLAB is very primitive..
Hello all,

We are very new to fieldtrip and troubleshooting Matlab code in general (we
are used to GUIs!). We have a pipeline set up now via fieldtrip that we
adapted from a colleague but are running into some issues when trying to
adapt it to our own needs.

For some reason I am getting this error after trying to run the define
trial portion:
I have copied the exact path for the file so I am unsure why that "doesn't
exist"
The other two errors escape me entirely.
[image: Screen Shot 2020-03-20 at 2.29.45 PM.png]

I have read extensively the fieldtrip walkthroughs and tutorials online and
we did not feel they addressed the problems we are currently experiencing.
Thanks all for the patience,

-- 
Ryan Priefer
Lab Technical Coordinator
Communication Sciences and Disorders
t: 516.877.6787
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/c480c471/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-03-20 at 2.29.45 PM.png
Type: image/png
Size: 177253 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/c480c471/attachment.png>

From stephen.whitmarsh at gmail.com  Mon Mar 23 19:50:18 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Mon, 23 Mar 2020 19:50:18 +0100
Subject: [FieldTrip] Problem with timelockanalysis
In-Reply-To: <CAB8HUkXAsL9MjNorLYH628jn9c0mUEkaHzJJ4JxeDcE5uRZv6w@mail.gmail.com>
References: <CAB8HUkXAsL9MjNorLYH628jn9c0mUEkaHzJJ4JxeDcE5uRZv6w@mail.gmail.com>
Message-ID: <CAFrxm=wiTXTumm8y82mCL3yTkJTgGaR2qJJP9N76aN7CXYJTug@mail.gmail.com>

Hi Amira,

Welcome!

I would indeed help if you could describe a bit more of your script getting
here, especially the cfg that you are using, and the data structure that
you are trying to run ft_timelockanalysis on (EEG_ft). Concerning the
latter, you can e.g. copy-paste the output of the command line when you
type EEG_ft.

Cheers,
Stephen

Op ma 23 mrt. 2020 om 19:12 schreef Amira Korkor <amira.korkor at gmail.com>:

> Hello,
> I am new to Fieldtrip and this forum so please feel free to let me know if
> the information I'm providing is sufficient to answer my question. I'm
> having trouble with the timelockanalysis function as below. Does anyone
> know why this might be happening?
> Thanks for your help,
> Amira
>
> I'm running the following script in MATLAB_R2018b / fieldtrip-20181231. I
> have tried running it on multiple older versions of Fieldtrip and gotten
> similar errors:
> *ERP(cond_i).erps(part_i) = ft_timelockanalysis (cfg, EEG_ft);*
>
> and receiving the following error:
>
>
>
>
>
>
>
>
>
>
> *Error using tabular/reshape (line 194)Undefined function 'reshape' for
> input arguments of type 'table'.Error in ft_selectdata>squeezedim (line
> 1220)  x = reshape(x, [siz(~dim) 1]);Error in ft_selectdata (line 381)
> varargin{i}.(datfield{j}) = squeezedim(varargin{i}.(datfield{j}),
> ~keepdim);Error in ft_timelockanalysis (line 195)data   =
> ft_selectdata(tmpcfg, data);*
>
>
> _______________________________________________
> 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/20200323/7bbad724/attachment.htm>

From stephen.whitmarsh at gmail.com  Mon Mar 23 19:58:08 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Mon, 23 Mar 2020 19:58:08 +0100
Subject: [FieldTrip] ft_definetrial errors
In-Reply-To: <CAHto=cha1mXKErctRDJOOAO_u3V5SiwtdvEUmLHTQ_vH0EhSMQ@mail.gmail.com>
References: <CAHto=cha1mXKErctRDJOOAO_u3V5SiwtdvEUmLHTQ_vH0EhSMQ@mail.gmail.com>
Message-ID: <CAFrxm=wQAXv7fSNqpmh76gt74KcBaCf0cziCbOFphjGmCz3Seg@mail.gmail.com>

Hi Ryan,

I would believe what MATLAB tells you, and doublecheck the path :). As it
doesn't start with a slash (/) it will use it relative to your current
directory (type 'pwd' in MATLAB), or check the bar in the top of the GUI
somewhere.
One way to check is to type something like: dir(YourPathAndFileName); and
see if it can find your file.
Best is to use an absolute path here, i.e. starting with either ~/ (for
your home), or even C:/ (for your C drive root) and go from there.
The other errors are a consequences of the first error, so you can ignore
those.

Cheers,
STephen

Op ma 23 mrt. 2020 om 19:47 schreef Ryan Priefer <rpriefer at adelphi.edu>:

> I was just working through the scripts you sent (thank you sooo much. Just
> having it all together like this is already bounds better than where I was
> before). That said I have already run into some issues since my experience
> with MATLAB is very primitive..
> Hello all,
>
> We are very new to fieldtrip and troubleshooting Matlab code in general
> (we are used to GUIs!). We have a pipeline set up now via fieldtrip that we
> adapted from a colleague but are running into some issues when trying to
> adapt it to our own needs.
>
> For some reason I am getting this error after trying to run the define
> trial portion:
> I have copied the exact path for the file so I am unsure why that "doesn't
> exist"
> The other two errors escape me entirely.
> [image: Screen Shot 2020-03-20 at 2.29.45 PM.png]
>
> I have read extensively the fieldtrip walkthroughs and tutorials online
> and we did not feel they addressed the problems we are currently
> experiencing.
> Thanks all for the patience,
>
> --
> Ryan Priefer
> Lab Technical Coordinator
> Communication Sciences and Disorders
> t: 516.877.6787
> _______________________________________________
> 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/20200323/dabfeca1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-03-20 at 2.29.45 PM.png
Type: image/png
Size: 177253 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/dabfeca1/attachment.png>

From richard.jie.cui at gmail.com  Mon Mar 23 20:12:18 2020
From: richard.jie.cui at gmail.com (Richard Cui)
Date: Mon, 23 Mar 2020 14:12:18 -0500
Subject: [FieldTrip] ft_definetrial errors
In-Reply-To: <CAHto=cha1mXKErctRDJOOAO_u3V5SiwtdvEUmLHTQ_vH0EhSMQ@mail.gmail.com>
References: <CAHto=cha1mXKErctRDJOOAO_u3V5SiwtdvEUmLHTQ_vH0EhSMQ@mail.gmail.com>
Message-ID: <DB3EDCFA-E788-4831-B346-CFC1858EDAC9@gmail.com>

Hi Ryan,

I guess you need that magic backslash ‘/‘. Could you try this: cfg.datafile=“/Macintosh HD/Applications/MATLAB_Plugins/AV1_AV.mff’;

---------
Richard J Cui, MS, PhD
Mayo Clinic

> On Mar 23, 2020, at 1:45 PM, Ryan Priefer <rpriefer at adelphi.edu> wrote:
> 
> ﻿
> I was just working through the scripts you sent (thank you sooo much. Just having it all together like this is already bounds better than where I was before). That said I have already run into some issues since my experience with MATLAB is very primitive..
> Hello all,
> 
> We are very new to fieldtrip and troubleshooting Matlab code in general (we are used to GUIs!). We have a pipeline set up now via fieldtrip that we adapted from a colleague but are running into some issues when trying to adapt it to our own needs.
> 
> For some reason I am getting this error after trying to run the define trial portion:
> I have copied the exact path for the file so I am unsure why that "doesn't exist"
> The other two errors escape me entirely.
> <Screen Shot 2020-03-20 at 2.29.45 PM.png>
> 
> I have read extensively the fieldtrip walkthroughs and tutorials online and we did not feel they addressed the problems we are currently experiencing.
> Thanks all for the patience,
> 
> -- 
> Ryan Priefer
> Lab Technical Coordinator
> Communication Sciences and Disorders
> t: 516.877.6787
> _______________________________________________
> 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/20200323/47eac544/attachment.htm>

From rpriefer at adelphi.edu  Mon Mar 23 20:20:12 2020
From: rpriefer at adelphi.edu (Ryan Priefer)
Date: Mon, 23 Mar 2020 15:20:12 -0400
Subject: [FieldTrip] ft_definetrial errors
In-Reply-To: <CAFrxm=wQAXv7fSNqpmh76gt74KcBaCf0cziCbOFphjGmCz3Seg@mail.gmail.com>
References: <CAHto=cha1mXKErctRDJOOAO_u3V5SiwtdvEUmLHTQ_vH0EhSMQ@mail.gmail.com>
 <CAFrxm=wQAXv7fSNqpmh76gt74KcBaCf0cziCbOFphjGmCz3Seg@mail.gmail.com>
Message-ID: <CAHto=chKhLfO8oG5qPf2NY2jTakc6fHXLnWiyEF_5ROcE+__nQ@mail.gmail.com>

Hi Stephen,

Thank you. I simply removed Macintosh HD from the code and it worked. It
seemed to work but then was greeted with this error:
"Error using ft_definetrial (line 196)
no trials were defined, see FT_DEFINETRIAL for help"

Another question I had was regarding the cfg.trialdef.eventvalue portion,
we have two conditions (a standard and a deviant, codes/labels: '2bst_' and
'2gdv_' respectively). Is cfg.trialdef.eventvalue{'1 2'} appropriate as
stand-ins or do I put the actual values of the triggers? Is "trigger" not
the correct word in this case to use?

Thank you,


On Mon, Mar 23, 2020 at 2:58 PM Stephen Whitmarsh <
stephen.whitmarsh at gmail.com> wrote:

> Hi Ryan,
>
> I would believe what MATLAB tells you, and doublecheck the path :). As it
> doesn't start with a slash (/) it will use it relative to your current
> directory (type 'pwd' in MATLAB), or check the bar in the top of the GUI
> somewhere.
> One way to check is to type something like: dir(YourPathAndFileName); and
> see if it can find your file.
> Best is to use an absolute path here, i.e. starting with either ~/ (for
> your home), or even C:/ (for your C drive root) and go from there.
> The other errors are a consequences of the first error, so you can ignore
> those.
>
> Cheers,
> STephen
>
> Op ma 23 mrt. 2020 om 19:47 schreef Ryan Priefer <rpriefer at adelphi.edu>:
>
>> I was just working through the scripts you sent (thank you sooo much.
>> Just having it all together like this is already bounds better than where I
>> was before). That said I have already run into some issues since my
>> experience with MATLAB is very primitive..
>> Hello all,
>>
>> We are very new to fieldtrip and troubleshooting Matlab code in general
>> (we are used to GUIs!). We have a pipeline set up now via fieldtrip that we
>> adapted from a colleague but are running into some issues when trying to
>> adapt it to our own needs.
>>
>> For some reason I am getting this error after trying to run the define
>> trial portion:
>> I have copied the exact path for the file so I am unsure why that
>> "doesn't exist"
>> The other two errors escape me entirely.
>> [image: Screen Shot 2020-03-20 at 2.29.45 PM.png]
>>
>> I have read extensively the fieldtrip walkthroughs and tutorials online
>> and we did not feel they addressed the problems we are currently
>> experiencing.
>> Thanks all for the patience,
>>
>> --
>> Ryan Priefer
>> Lab Technical Coordinator
>> Communication Sciences and Disorders
>> t: 516.877.6787
>> _______________________________________________
>> 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
>


-- 
Ryan Priefer
Lab Technical Coordinator
Communication Sciences and Disorders
t: 516.877.6787
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/09bdcc0e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-03-20 at 2.29.45 PM.png
Type: image/png
Size: 177253 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/09bdcc0e/attachment.png>

From amira.korkor at gmail.com  Tue Mar 24 00:49:01 2020
From: amira.korkor at gmail.com (Amira Korkor)
Date: Mon, 23 Mar 2020 23:49:01 +0000
Subject: [FieldTrip] Problem with timelockanalysis
In-Reply-To: <CAFrxm=wiTXTumm8y82mCL3yTkJTgGaR2qJJP9N76aN7CXYJTug@mail.gmail.com>
References: <CAB8HUkXAsL9MjNorLYH628jn9c0mUEkaHzJJ4JxeDcE5uRZv6w@mail.gmail.com>
 <CAFrxm=wiTXTumm8y82mCL3yTkJTgGaR2qJJP9N76aN7CXYJTug@mail.gmail.com>
Message-ID: <CAB8HUkWXpYg9tPjU+r90f7tsm0JJoik8Yem1-3q=KXKh-08gXg@mail.gmail.com>

Hello Stephen,
Thank you for your reply. I'm bewildered - I went back now to run that line
in order to copy the output for you and it ran without issue, even though I
have changed absolutely nothing since earlier today. I'll come back if it
stops working but I'm hoping it was just a fluke!
Many thanks,
Amira



On Mon, 23 Mar 2020 at 19:02, Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
wrote:

> Hi Amira,
>
> Welcome!
>
> I would indeed help if you could describe a bit more of your script
> getting here, especially the cfg that you are using, and the data structure
> that you are trying to run ft_timelockanalysis on (EEG_ft). Concerning the
> latter, you can e.g. copy-paste the output of the command line when you
> type EEG_ft.
>
> Cheers,
> Stephen
>
> Op ma 23 mrt. 2020 om 19:12 schreef Amira Korkor <amira.korkor at gmail.com>:
>
>> Hello,
>> I am new to Fieldtrip and this forum so please feel free to let me know
>> if the information I'm providing is sufficient to answer my question. I'm
>> having trouble with the timelockanalysis function as below. Does anyone
>> know why this might be happening?
>> Thanks for your help,
>> Amira
>>
>> I'm running the following script in MATLAB_R2018b / fieldtrip-20181231. I
>> have tried running it on multiple older versions of Fieldtrip and gotten
>> similar errors:
>> *ERP(cond_i).erps(part_i) = ft_timelockanalysis (cfg, EEG_ft);*
>>
>> and receiving the following error:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Error using tabular/reshape (line 194)Undefined function 'reshape' for
>> input arguments of type 'table'.Error in ft_selectdata>squeezedim (line
>> 1220)  x = reshape(x, [siz(~dim) 1]);Error in ft_selectdata (line 381)
>> varargin{i}.(datfield{j}) = squeezedim(varargin{i}.(datfield{j}),
>> ~keepdim);Error in ft_timelockanalysis (line 195)data   =
>> ft_selectdata(tmpcfg, data);*
>>
>>
>> _______________________________________________
>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/d1d587c3/attachment.htm>

From fabio.masina83 at gmail.com  Tue Mar 24 11:36:20 2020
From: fabio.masina83 at gmail.com (Fabio Masina)
Date: Tue, 24 Mar 2020 11:36:20 +0100
Subject: [FieldTrip] Invalid MEX-file_combineClusters.mexw64
Message-ID: <CAPJmCpHfKrPsUvdaY2iYDQ0vzu3Z6U4AX=HADwmiHoDxaqjczg@mail.gmail.com>

Dear Community,

my name is Fabio and I'm not a Fieldtrip expert. So my apologies if my
question will seem trivial.

I'm facing a problem when I try to run the function ft_freqstatistics.
Actually, I'm trying to call the ft_freqstatistics function from Brainstorm
and the error shows:
Error: [process_ft_freqstatistics]  Test > FieldTrip: ft_freqstatistics
** Line 101: Invalid MEX-file
'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64':
Impossibile trovare il modulo specificato.

Typing in the Matlab command window the command "combineClusters", again
the error message shows:
Invalid MEX-file
'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64':
Impossibile trovare il modulo specificato.

These are my current versions of Fieldtrip, Matlab, and OS:
fieldtrip-20200320, Matlab R2019b, Windows 10 v1903 (OS Builds 18362.720).

Following a suggestion, I tried to check if some dll file missing on my
computer. Thus, I used the Dependency Walker utility
http://www.dependencywalker.com. However, I'm not able to correctly use
this utility, especially I cannot interpret the output.

Have you some suggestions? Any help would be appreciated.

Best,

Fabio

-- 

*Fabio Masina, PhD*

IRCCS, Ospedale San Camillo
Via Alberoni 70, 30126
Venice, Italy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200324/baf4e8de/attachment.htm>

From hyxer1998 at 163.com  Wed Mar 25 08:30:53 2020
From: hyxer1998 at 163.com (=?UTF-8?B?6LWr6Zuo5qyj?=)
Date: Wed, 25 Mar 2020 15:30:53 +0800 (CST)
Subject: [FieldTrip] Help with plotting all the sensors belonging to the
 significant clusters in only one scalp topography
Message-ID: <5d5d5e53.35ca.1711099e5a2.Coremail.hyxer1998@163.com>

﻿Dear fieldtrip users:
I just started to use fieldtrip and I have a trivial question asking for help. 
I’m trying to find out the labels of the sensors belonging to the significant clusters. I think maybe I can find some threads in stat.posclusterslabelmat or stat.negclusterslabelmat and in stat.mask but  they are all in three dimensions chan_freq_time, I don’t know how to do it exactly in codes. 
Hope someone can help me. Thank you very much. 
From HeYuxin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200325/1f34a2c5/attachment.htm>

From jan.schoffelen at donders.ru.nl  Wed Mar 25 09:08:00 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 25 Mar 2020 08:08:00 +0000
Subject: [FieldTrip] Invalid MEX-file_combineClusters.mexw64
In-Reply-To: <CAPJmCpHfKrPsUvdaY2iYDQ0vzu3Z6U4AX=HADwmiHoDxaqjczg@mail.gmail.com>
References: <CAPJmCpHfKrPsUvdaY2iYDQ0vzu3Z6U4AX=HADwmiHoDxaqjczg@mail.gmail.com>
Message-ID: <EB7D1220-D8C7-4893-9494-2D78F2141AAD@donders.ru.nl>

Hi Fabio,

I rarely use Matlab on windows myself, so I don’t have a solution handy. As Robert suggested earlier, the error is likely caused by the compiled mex file being incompatible with your computer.
Typing the error in google led me to the documentation below, perhaps you can take it from there.

https://www.mathworks.com/matlabcentral/answers/92040-why-do-i-receive-a-specified-module-could-not-be-found-error-while-running-a-mex-file-created-from

Alternatively, you could try and recompile the mex-files on your computer, which in my experience on PCs requires some fooling around. As a last resort, you could remove the .mexw64 file altogether, and rely in the slower *.m file.


Good luck,

Jan-Mathijs



On 24 Mar 2020, at 11:36, Fabio Masina <fabio.masina83 at gmail.com> wrote:

Dear Community,

my name is Fabio and I'm not a Fieldtrip expert. So my apologies if my question will seem trivial.

I'm facing a problem when I try to run the function ft_freqstatistics. Actually, I'm trying to call the ft_freqstatistics function from Brainstorm and the error shows:
Error: [process_ft_freqstatistics]  Test > FieldTrip: ft_freqstatistics
** Line 101: Invalid MEX-file 'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64': Impossibile trovare il modulo specificato.

Typing in the Matlab command window the command "combineClusters", again the error message shows:
Invalid MEX-file
'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64':
Impossibile trovare il modulo specificato.

These are my current versions of Fieldtrip, Matlab, and OS: fieldtrip-20200320, Matlab R2019b, Windows 10 v1903 (OS Builds 18362.720).

Following a suggestion, I tried to check if some dll file missing on my computer. Thus, I used the Dependency Walker utility http://www.dependencywalker.com<http://www.dependencywalker.com/>. However, I'm not able to correctly use this utility, especially I cannot interpret the output.

Have you some suggestions? Any help would be appreciated.

Best,

Fabio

--
Fabio Masina, PhD

IRCCS, Ospedale San Camillo
Via Alberoni 70, 30126
Venice, Italy
_______________________________________________
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/20200325/56125bee/attachment.htm>

From julian.keil at gmail.com  Wed Mar 25 09:15:37 2020
From: julian.keil at gmail.com (Julian Keil)
Date: Wed, 25 Mar 2020 09:15:37 +0100
Subject: [FieldTrip] Help with plotting all the sensors belonging to the
 significant clusters in only one scalp topography
In-Reply-To: <5d5d5e53.35ca.1711099e5a2.Coremail.hyxer1998@163.com>
References: <5d5d5e53.35ca.1711099e5a2.Coremail.hyxer1998@163.com>
Message-ID: <F64CF369-0A65-4B6A-BBD8-A152507E1D30@gmail.com>

Dear HeYuxin,

you can use something like this to find the channel, frequency and time indices of your clusters:

[chan,freq,time] = ind2sub(size(stats.posclusterslabelmat),...
    find(stats.posclusterslabelmat == 1));
chan = unique(chan);
freq = unique(freq);
time = unique(time);

Hope this helps,

Julian

________________
Prof. Dr. Julian Keil

Biologische Psychologie
Olshausenstraße 62 - R. 306
24118 Kiel

0431 / 880 - 4872
http://www.biopsych.uni-kiel.de/



> Am 25.03.2020 um 08:30 schrieb 赫雨欣 <hyxer1998 at 163.com>:
> 
> ﻿Dear fieldtrip users:
> I just started to use fieldtrip and I have a trivial question asking for help. 
> I’m trying to find out the labels of the sensors belonging to the significant clusters. I think maybe I can find some threads in stat.posclusterslabelmat or stat.negclusterslabelmat and in stat.mask but  they are all in three dimensions chan_freq_time, I don’t know how to do it exactly in codes. 
> Hope someone can help me. Thank you very much. 
> From HeYuxin
> 
> 
> 
>  
> _______________________________________________
> 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/20200325/293d8a53/attachment.htm>

From stephen.whitmarsh at gmail.com  Wed Mar 25 09:31:56 2020
From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh)
Date: Wed, 25 Mar 2020 09:31:56 +0100
Subject: [FieldTrip] Help with plotting all the sensors belonging to the
 significant clusters in only one scalp topography
In-Reply-To: <5d5d5e53.35ca.1711099e5a2.Coremail.hyxer1998@163.com>
References: <5d5d5e53.35ca.1711099e5a2.Coremail.hyxer1998@163.com>
Message-ID: <CAFrxm=zanW3-VQ5Cq9epCaMJYSDGmFu7hViDv50dLetzj_cxUg@mail.gmail.com>

Dear HeYuxin,

Welcome to FieldTrip!

I saw that Julian just gave a better solution than what I was writing you,
so let me just leave you my preamble:

I assume you have done some cluster analyses over channels, frequencies and
time point. In other words, you might have clusters spanning over three
dimensions. Some channels might not be part of the cluster at some time
points, some frequencies not at certain channels, etc. etc. So you will
first have to decide what you want to look at. For instance: channels that
at *any *point and at *any *frequency were part of a cluster? That might
not be easy to interpret - what does a 'significant channel' mean in this
case? Since you say you are new in FieldTrip, I'd like to offer some
advise that might be useful here, perhaps also for others:

- Don't *start *with cluster-analyses, especially not over multiple
dimensions.
- First explore your hypothesis more directly. Your hypothesis probably is
not 'any effect at any time in any frequency in any channel'. Try to be
more precise, e.g.: at what frequencies do you expect your effect. And at
what time-period?
- If you can average over a dimension, do it. I.e. if you expect a certain
frequency band (e.g. alpha 8-14Hz) to show an effect, average over that
dimension. You can even do this in ft_freqanalysis.
- Try to avoid more than 2 dimensions in cluster-analyses. It makes
interpretation (and plotting!) much easier.
- If you absolutely need to explore 3 dimensions, you can plot the results
using ft_clusterplot.
- Reading this
<http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test/>
might help understand also how you would need to report cluster-analyses
statistics, and the limitations of their interpretation.
- To summarize: *Cluster analyses is meant to deal with the multiple
comparison problem, not a lack of precision in your hypotheses*. I do not
say this to be pedantic, but to help you avoid becoming trapped in a
circular multidimensional analyses chasing false positives, let alone
risking unconsciously p-hacking and HARKing.

I hope this helps!

Best wishes,
Stephen



Op wo 25 mrt. 2020 om 08:43 schreef 赫雨欣 <hyxer1998 at 163.com>:

> ﻿Dear fieldtrip users:
> I just started to use fieldtrip and I have a trivial question asking for
> help.
> I’m trying to find out the labels of the sensors belonging to the
> significant clusters. I think maybe I can find some threads in
> stat.posclusterslabelmat or stat.negclusterslabelmat and in stat.mask but
>  they are all in three dimensions chan_freq_time, I don’t know how to do it
> exactly in codes.
> Hope someone can help me. Thank you very much.
> From HeYuxin
>
>
>
>
> _______________________________________________
> 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/20200325/cda86ce3/attachment.htm>

From fabio.masina83 at gmail.com  Thu Mar 26 08:47:54 2020
From: fabio.masina83 at gmail.com (Fabio Masina)
Date: Thu, 26 Mar 2020 08:47:54 +0100
Subject: [FieldTrip] Invalid MEX-file_combineClusters.mexw64
In-Reply-To: <EB7D1220-D8C7-4893-9494-2D78F2141AAD@donders.ru.nl>
References: <CAPJmCpHfKrPsUvdaY2iYDQ0vzu3Z6U4AX=HADwmiHoDxaqjczg@mail.gmail.com>
 <EB7D1220-D8C7-4893-9494-2D78F2141AAD@donders.ru.nl>
Message-ID: <CAPJmCpFAhp=qr8aegGhV3BSS+CCwtxuTtybp8t3-7f3eeZO_5w@mail.gmail.com>

Hi Jan-Mathij,

interestingly, after removing the .mex files altogether (i.e.
combineClusters.mexa64, combineClusters.mexw32, and combineClusters.mexw64)
I could run the ft_freqstatistics function. So it apparently works.

Thanks for your suggestions,

Fabio

Il giorno mer 25 mar 2020 alle ore 09:35 Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> ha scritto:

> Hi Fabio,
>
> I rarely use Matlab on windows myself, so I don’t have a solution handy.
> As Robert suggested earlier, the error is likely caused by the compiled mex
> file being incompatible with your computer.
> Typing the error in google led me to the documentation below, perhaps you
> can take it from there.
>
>
> https://www.mathworks.com/matlabcentral/answers/92040-why-do-i-receive-a-specified-module-could-not-be-found-error-while-running-a-mex-file-created-from
>
> Alternatively, you could try and recompile the mex-files on your computer,
> which in my experience on PCs requires some fooling around. As a last
> resort, you could remove the .mexw64 file altogether, and rely in the
> slower *.m file.
>
>
> Good luck,
>
> Jan-Mathijs
>
>
>
> On 24 Mar 2020, at 11:36, Fabio Masina <fabio.masina83 at gmail.com> wrote:
>
> Dear Community,
>
> my name is Fabio and I'm not a Fieldtrip expert. So my apologies if my
> question will seem trivial.
>
> I'm facing a problem when I try to run the function ft_freqstatistics.
> Actually, I'm trying to call the ft_freqstatistics function from Brainstorm
> and the error shows:
> Error: [process_ft_freqstatistics]  Test > FieldTrip: ft_freqstatistics
> ** Line 101: Invalid MEX-file
> 'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64':
> Impossibile trovare il modulo specificato.
>
> Typing in the Matlab command window the command "combineClusters", again
> the error message shows:
> Invalid MEX-file
>
> 'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64':
> Impossibile trovare il modulo specificato.
>
> These are my current versions of Fieldtrip, Matlab, and OS:
> fieldtrip-20200320, Matlab R2019b, Windows 10 v1903 (OS Builds 18362.720).
>
> Following a suggestion, I tried to check if some dll file missing on my
> computer. Thus, I used the Dependency Walker utility
> http://www.dependencywalker.com. However, I'm not able to correctly use
> this utility, especially I cannot interpret the output.
>
> Have you some suggestions? Any help would be appreciated.
>
> Best,
>
> Fabio
>
> --
>
> *Fabio Masina, PhD *
>
> IRCCS, Ospedale San Camillo
> Via Alberoni 70, 30126
> Venice, Italy
> _______________________________________________
> 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
>


-- 

*Fabio Masina, PhD*

IRCCS, Ospedale San Camillo
Via Alberoni 70, 30126
Venice, Italy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200326/5e21f443/attachment.htm>

From jan.schoffelen at donders.ru.nl  Thu Mar 26 09:51:45 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Thu, 26 Mar 2020 08:51:45 +0000
Subject: [FieldTrip] Invalid MEX-file_combineClusters.mexw64
In-Reply-To: <CAPJmCpFAhp=qr8aegGhV3BSS+CCwtxuTtybp8t3-7f3eeZO_5w@mail.gmail.com>
References: <CAPJmCpHfKrPsUvdaY2iYDQ0vzu3Z6U4AX=HADwmiHoDxaqjczg@mail.gmail.com>
 <EB7D1220-D8C7-4893-9494-2D78F2141AAD@donders.ru.nl>
 <CAPJmCpFAhp=qr8aegGhV3BSS+CCwtxuTtybp8t3-7f3eeZO_5w@mail.gmail.com>
Message-ID: <81DE3C29-07C2-4927-8091-86C952ED07C3@donders.ru.nl>

Ciao Fabio,
Good! Thanks for the feedback,
Jan-Mathijs

On 26 Mar 2020, at 08:47, Fabio Masina <fabio.masina83 at gmail.com<mailto:fabio.masina83 at gmail.com>> wrote:

Hi Jan-Mathij,

interestingly, after removing the .mex files altogether (i.e. combineClusters.mexa64, combineClusters.mexw32, and combineClusters.mexw64) I could run the ft_freqstatistics function. So it apparently works.

Thanks for your suggestions,

Fabio

Il giorno mer 25 mar 2020 alle ore 09:35 Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> ha scritto:
Hi Fabio,

I rarely use Matlab on windows myself, so I don’t have a solution handy. As Robert suggested earlier, the error is likely caused by the compiled mex file being incompatible with your computer.
Typing the error in google led me to the documentation below, perhaps you can take it from there.

https://www.mathworks.com/matlabcentral/answers/92040-why-do-i-receive-a-specified-module-could-not-be-found-error-while-running-a-mex-file-created-from

Alternatively, you could try and recompile the mex-files on your computer, which in my experience on PCs requires some fooling around. As a last resort, you could remove the .mexw64 file altogether, and rely in the slower *.m file.


Good luck,

Jan-Mathijs



On 24 Mar 2020, at 11:36, Fabio Masina <fabio.masina83 at gmail.com<mailto:fabio.masina83 at gmail.com>> wrote:

Dear Community,

my name is Fabio and I'm not a Fieldtrip expert. So my apologies if my question will seem trivial.

I'm facing a problem when I try to run the function ft_freqstatistics. Actually, I'm trying to call the ft_freqstatistics function from Brainstorm and the error shows:
Error: [process_ft_freqstatistics]  Test > FieldTrip: ft_freqstatistics
** Line 101: Invalid MEX-file 'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64': Impossibile trovare il modulo specificato.

Typing in the Matlab command window the command "combineClusters", again the error message shows:
Invalid MEX-file
'C:\Users\fabio\Documents\Research\Analyses\EEG\fieldtrip-20200320\fieldtrip-20200320\private\combineClusters.mexw64':
Impossibile trovare il modulo specificato.

These are my current versions of Fieldtrip, Matlab, and OS: fieldtrip-20200320, Matlab R2019b, Windows 10 v1903 (OS Builds 18362.720).

Following a suggestion, I tried to check if some dll file missing on my computer. Thus, I used the Dependency Walker utility http://www.dependencywalker.com<http://www.dependencywalker.com/>. However, I'm not able to correctly use this utility, especially I cannot interpret the output.

Have you some suggestions? Any help would be appreciated.

Best,

Fabio

--
Fabio Masina, PhD

IRCCS, Ospedale San Camillo
Via Alberoni 70, 30126
Venice, Italy
_______________________________________________
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


--
Fabio Masina, PhD

IRCCS, Ospedale San Camillo
Via Alberoni 70, 30126
Venice, Italy
_______________________________________________
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/20200326/35935376/attachment.htm>

From alessandra.griffa at gmail.com  Sat Mar 28 16:10:12 2020
From: alessandra.griffa at gmail.com (Alessandra Griffa)
Date: Sat, 28 Mar 2020 16:10:12 +0100
Subject: [FieldTrip] LCMV beamformer for resting-state data: Which
 covariance matrix?
Message-ID: <CAAbUDoTE+vwCaQuMfuqq_PoPdBs-w_YxEvrc4WxVH=7QLhJbfQ@mail.gmail.com>

Dear FieldTrip Experts,

I would like to perform source reconstruction of resting-state MEG data
(splitted in multiple epochs or trials) using the LCMV beamformer approach.

I am not sure about how I should compute the covariance matrix.
All FildTrip tutorials refer to the function ft_timelockanalysis, which in
my case will compute the average time series across trials and then the
covariance matrix from the averaged time series.
This does not sound correct to me: should I rather concatenate all my
trials, and let ft_timelockanalysis compute the covariance matrix on the
concatenated data?
Or, how could I 'trick' the data.trialinfo variable so that
ft_timelockanalysis correctly interpret my data as resting-state?

Thank you very much for your help!
Alessandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200328/f2792757/attachment.htm>

From jiahua.xu at med.ovgu.de  Mon Mar 30 11:01:19 2020
From: jiahua.xu at med.ovgu.de (Xu, Jiahua)
Date: Mon, 30 Mar 2020 09:01:19 +0000
Subject: [FieldTrip] Network analysis tutorial : connecitvity first or
 parcellatation first
Message-ID: <cae8764b29af430e8f0710e102a42b44@med.ovgu.de>

Dear All

I'm a little confused about this tutorial  here: https://www.fieldtriptoolbox.org/tutorial/networkanalysis/

In this tutorial,  the author calculated the connectivity-based per dipole then parcellated with the atlas.

However, like in Brainstorm, the pipeline they published is to parcellated first then calculate the connectivity based on per parcellated label. https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity

So what the difference between these and why you prefer this way or in fact they did the same thing, but computing the connectivity per dipole costs more computation power?

Thanks so much and keep safe everybody.

Best regards

Jack Xu




From icon2020fi at gmail.com  Mon Mar 30 16:54:33 2020
From: icon2020fi at gmail.com (Icon 2020)
Date: Mon, 30 Mar 2020 17:54:33 +0300
Subject: [FieldTrip] ICON 2020 postponed to May 2021
Message-ID: <CAFjOfi+4oCfb0bX0X7suVEPuZWgJxKScVqYS7KENej-FzD1gzQ@mail.gmail.com>

 Dear colleagues,

In the light of the COVID-19 pandemia and worldwide travel restrictions,
the ICON 2020 conference will be postponed to 2021. New dates for the
conference are 16-20.5.2021. I hope to see many of you in the ICON 2021.
Please follow the ICON webpage for more information.

https://www.helsinki.fi/en/conferences/international-conference-of-cognitive-neuroscience-2020

We are sincerely sorry about the current situation and our thoughts are
with many of our friends and colleagues  affected by the virus.

Stay safe,
All the best,

Satu Palva




www.icon2020.org

Vice-director, Group Leader

Neuroscience Center, HiLIFE

University of Helsinki, Finland
Professor, Centre for Cognitive Neuroimaging

Institute of Neuroscience and Psychology

University of Glasgow, UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200330/06846828/attachment.htm>

From ecaspar at ulb.ac.be  Tue Mar 31 10:42:52 2020
From: ecaspar at ulb.ac.be (Emilie Caspar)
Date: Tue, 31 Mar 2020 10:42:52 +0200
Subject: [FieldTrip] ft_sourcemovie - producing 'contemporary art' instead
 of a brain
Message-ID: <B7A355FC-6AFF-496E-94EE-485D44429D28@ulb.ac.be>

Dear all, 

I am trying to compute a source reconstruction of different ERPs between two experimental conditions. Well, good news is that the script ‘works’, but the issue is that I am producing contemporary art instead of a brain with ft_sourcemovie (see figure in attachement). The headmodel I used is the standard one available for download. The leadfield I built seems to look like a brain with a correct positions of the electrodes (see also figure in attachement). 

I really have no cue about how I produced such output with ft_sourcemovie and what could possibly be the issue (code is below). If someone can help transforming this to a brain? ;-)
The only thing that differs (I think) from the tutorial is that I don’t have a headmodel.tri but rather a headmodel.bnd.tri. Don’t know if it makes any difference. Perhaps the sourcespace defined in the tutorial is something different?

Thank you, 

Emilie



CODE

q=biosim64;
ph = cell2mat(q(:,2));
th = cell2mat(q(:,3));
x = sin(ph*pi/180) .* cos(th*pi/180);
y = sin(ph*pi/180) .* sin(th*pi/180);
z = cos(ph*pi/180);
 
plot3(x, y, z, '.');
elec.label = q(:,1);
elec.pnt = [x y z];
 
cfg.sourcemodel.pos = elec.pnt;
sourcemodel = ft_prepare_sourcemodel(cfg);
 
headmodel = ft_read_headmodel('headmodel/standard_bem.mat');
 
% realign electrodes to headmodel
cfg = [];
cfg.method = 'interactive';
cfg.elec = elec;
cfg.headshape = headmodel.bnd(1); %1 = skin
elec = ft_electroderealign(cfg);
 
%save new electrodes
save elec64.mat elec
 
ERPsAll.elec = ft_read_sens('elec64.mat’);

% Prepare leadfield
cfg                 = [];
cfg.elec            = ERPsAll.elec;
cfg.vol             = headmodel;
cfg.reducerank      = 3;
cfg.grid.resolution = 1;   % use a 3-D grid with a 1 cm resolution
cfg.grid.unit       = 'cm';
cfg.channel ={'all'};
leadfield = ft_prepare_leadfield(cfg);
 
%%mne
cfg              = [];
cfg.method       = 'mne'; %pcc: partial cannonical correlation/coherence
cfg.elec         = ERPsAll.elec; %grid.cfg.elec;%
cfg.headmodel          = headmodel;
cfg.grid = leadfield;
%cfg.sourcemodel = sourcemodel;
% cfg.channel ={'all'};%, '-spmnas', '-spmlpa', '-spmrpa'};
cfg.mne.prewhiten = 'yes';
cfg.mne.lambda    = 3;
cfg.mne.scalesourcecov = 'yes';
%cfg.reducerank          = 2;
 
source_C_Shock = ft_sourceanalysis(cfg, GA_C_Shock);
source_C_Noshock = ft_sourceanalysis(cfg, GA_C_NOshock);

save source_C_Shock.mat source_C_Shock
save source_C_Noshock.mat source_C_Noshock

bnd.pos = headmodel.bnd.pos;
bnd.tri = headmodel.bnd.tri;
 
m=source_C_Shock.avg.pow(:,450); 
%timeN1 = [1232:1301];timeP3 = [1722:1927];timeeLPP = [1928:2356];timelLPP = [2357:2868];
ft_plot_mesh(bnd, 'vertexcolor', m);
view([180 0]); h = light; set(h, 'position', [0 1 0.2]); lighting gouraud; material dull
 
cfg = [];
cfg.projectmom = 'yes';
sdShock  = ft_sourcedescriptives(cfg,source_C_Shock);
sdNoShock = ft_sourcedescriptives(cfg,source_C_Noshock);
 
sdDIFF         = sdNoShock;
sdDIFF.avg.pow = sdNoShock.avg.pow - sdShock.avg.pow;
sdDIFF.tri = headmodel.bnd.tri;
 
save sd sdDIFF;
 
cfg = [];
cfg.funparameter = 'pow';
%cfg.method       = 'surface';
ft_sourcemovie(cfg,sdDIFF);


---------------------------------------------
Emilie Caspar, Ph.D
 
CO3, Centre de Recherche Cognition et Neurosciences (CRCN), ULB 
Voice : +32 2 650 32 95 
mail : ecaspar at ulb.ac.be
office: DB10-138 

Social Brain Lab, Netherlands Institute for Neuroscience (NIN), KNAW
mail : e.caspar at nin.knaw.nl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_sourcemovie.png
Type: image/png
Size: 141034 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: leadfield.png
Type: image/png
Size: 70775 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_plot_mesh.png
Type: image/png
Size: 94842 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment-0002.png>

From jan.schoffelen at donders.ru.nl  Tue Mar 31 11:07:44 2020
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Tue, 31 Mar 2020 09:07:44 +0000
Subject: [FieldTrip] ft_sourcemovie - producing 'contemporary art'
 instead of a brain
In-Reply-To: <B7A355FC-6AFF-496E-94EE-485D44429D28@ulb.ac.be>
References: <B7A355FC-6AFF-496E-94EE-485D44429D28@ulb.ac.be>
Message-ID: <C3B27185-3A5B-4CCB-A846-7DA76498A063@donders.ru.nl>

Hi Emilie,

ft_sourcemovie has been designed to operate on source level data that is defined on a cortical surface based source model.
The code you pasted in suggests that you used a 3-dimensional grid as a sourcemodel. So this is never going to work.
Apparently, you managed to fool the function by post-hoc including a so-called ’tri’ field, which is the hallmark that fieldtrip uses to determine whether the sourcemodel geometry was a mesh or not.
However, there is no relation whatsoever between the specified triangulation (which you took from the headmodel) and the dipole positions at which your source activity has been estimated.

Best wishes,
Jan-Mathijs


On 31 Mar 2020, at 10:42, Emilie Caspar <ecaspar at ulb.ac.be<mailto:ecaspar at ulb.ac.be>> wrote:

Dear all,

I am trying to compute a source reconstruction of different ERPs between two experimental conditions. Well, good news is that the script ‘works’, but the issue is that I am producing contemporary art instead of a brain with ft_sourcemovie (see figure in attachement). The headmodel I used is the standard one available for download. The leadfield I built seems to look like a brain with a correct positions of the electrodes (see also figure in attachement).

I really have no cue about how I produced such output with ft_sourcemovie and what could possibly be the issue (code is below). If someone can help transforming this to a brain? ;-)
The only thing that differs (I think) from the tutorial is that I don’t have a headmodel.tri but rather a headmodel.bnd.tri. Don’t know if it makes any difference. Perhaps the sourcespace defined in the tutorial is something different?

Thank you,

Emilie

<ft_sourcemovie.png><leadfield.png><ft_plot_mesh.png>

CODE

q=biosim64;
ph = cell2mat(q(:,2));
th = cell2mat(q(:,3));
x = sin(ph*pi/180) .* cos(th*pi/180);
y = sin(ph*pi/180) .* sin(th*pi/180);
z = cos(ph*pi/180);

plot3(x, y, z, '.');
elec.label = q(:,1);
elec.pnt = [x y z];

cfg.sourcemodel.pos = elec.pnt;
sourcemodel = ft_prepare_sourcemodel(cfg);

headmodel = ft_read_headmodel('headmodel/standard_bem.mat');

% realign electrodes to headmodel
cfg = [];
cfg.method = 'interactive';
cfg.elec = elec;
cfg.headshape = headmodel.bnd(1); %1 = skin
elec = ft_electroderealign(cfg);

%save new electrodes
save elec64.mat elec

ERPsAll.elec = ft_read_sens('elec64.mat’);

% Prepare leadfield
cfg                 = [];
cfg.elec            = ERPsAll.elec;
cfg.vol             = headmodel;
cfg.reducerank      = 3;
cfg.grid.resolution = 1;   % use a 3-D grid with a 1 cm resolution
cfg.grid.unit       = 'cm';
cfg.channel ={'all'};
leadfield = ft_prepare_leadfield(cfg);



%%mne
cfg              = [];
cfg.method       = 'mne'; %pcc: partial cannonical correlation/coherence
cfg.elec         = ERPsAll.elec; %grid.cfg.elec;%
cfg.headmodel          = headmodel;
cfg.grid = leadfield;
%cfg.sourcemodel = sourcemodel;
% cfg.channel ={'all'};%, '-spmnas', '-spmlpa', '-spmrpa'};
cfg.mne.prewhiten = 'yes';
cfg.mne.lambda    = 3;
cfg.mne.scalesourcecov = 'yes';
%cfg.reducerank          = 2;

source_C_Shock = ft_sourceanalysis(cfg, GA_C_Shock);
source_C_Noshock = ft_sourceanalysis(cfg, GA_C_NOshock);

save source_C_Shock.mat source_C_Shock
save source_C_Noshock.mat source_C_Noshock

bnd.pos = headmodel.bnd.pos;
bnd.tri = headmodel.bnd.tri;

m=source_C_Shock.avg.pow(:,450);
%timeN1 = [1232:1301];timeP3 = [1722:1927];timeeLPP = [1928:2356];timelLPP = [2357:2868];
ft_plot_mesh(bnd, 'vertexcolor', m);
view([180 0]); h = light; set(h, 'position', [0 1 0.2]); lighting gouraud; material dull

cfg = [];
cfg.projectmom = 'yes';
sdShock  = ft_sourcedescriptives(cfg,source_C_Shock);
sdNoShock = ft_sourcedescriptives(cfg,source_C_Noshock);

sdDIFF         = sdNoShock;
sdDIFF.avg.pow = sdNoShock.avg.pow - sdShock.avg.pow;
sdDIFF.tri = headmodel.bnd.tri;

save sd sdDIFF;

cfg = [];
cfg.funparameter = 'pow';
%cfg.method       = 'surface';
ft_sourcemovie(cfg,sdDIFF);


---------------------------------------------
Emilie Caspar, Ph.D

CO3, Centre de Recherche Cognition et Neurosciences (CRCN), ULB
Voice : +32 2 650 32 95
mail : ecaspar at ulb.ac.be<mailto:ecaspar at ulb.ac.be>
office: DB10-138

Social Brain Lab, Netherlands Institute for Neuroscience (NIN), KNAW
mail : e.caspar at nin.knaw.nl<mailto:e.caspar at nin.knaw.nl>

_______________________________________________
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/20200331/7fa04f55/attachment.htm>

From e.spaak at donders.ru.nl  Tue Mar 31 12:02:58 2020
From: e.spaak at donders.ru.nl (Eelke Spaak)
Date: Tue, 31 Mar 2020 12:02:58 +0200
Subject: [FieldTrip] ft_sourcemovie - producing 'contemporary art'
 instead of a brain
In-Reply-To: <C3B27185-3A5B-4CCB-A846-7DA76498A063@donders.ru.nl>
References: <B7A355FC-6AFF-496E-94EE-485D44429D28@ulb.ac.be>
 <C3B27185-3A5B-4CCB-A846-7DA76498A063@donders.ru.nl>
Message-ID: <CABPNLUooq6DXdvBZabmWGcG0T0wDrF65+YGykG0qY=Vchaa+hw@mail.gmail.com>

Hi Emilie,

To add to Jan-Mathijs' explanation of why this does not work: you can
use ft_sourceinterpolate to interpolate your volumetric source data
onto a surface, which you can then plot using ft_sourcemovie (or the
newer, though still somewhat experimental, ft_sourceplot_interactive).

Best,
Eelke

On Tue, 31 Mar 2020 at 11:07, Schoffelen, J.M. (Jan Mathijs)
<jan.schoffelen at donders.ru.nl> wrote:
>
> Hi Emilie,
>
> ft_sourcemovie has been designed to operate on source level data that is defined on a cortical surface based source model.
> The code you pasted in suggests that you used a 3-dimensional grid as a sourcemodel. So this is never going to work.
> Apparently, you managed to fool the function by post-hoc including a so-called ’tri’ field, which is the hallmark that fieldtrip uses to determine whether the sourcemodel geometry was a mesh or not.
> However, there is no relation whatsoever between the specified triangulation (which you took from the headmodel) and the dipole positions at which your source activity has been estimated.
>
> Best wishes,
> Jan-Mathijs
>
>
> On 31 Mar 2020, at 10:42, Emilie Caspar <ecaspar at ulb.ac.be> wrote:
>
> Dear all,
>
> I am trying to compute a source reconstruction of different ERPs between two experimental conditions. Well, good news is that the script ‘works’, but the issue is that I am producing contemporary art instead of a brain with ft_sourcemovie (see figure in attachement). The headmodel I used is the standard one available for download. The leadfield I built seems to look like a brain with a correct positions of the electrodes (see also figure in attachement).
>
> I really have no cue about how I produced such output with ft_sourcemovie and what could possibly be the issue (code is below). If someone can help transforming this to a brain? ;-)
> The only thing that differs (I think) from the tutorial is that I don’t have a headmodel.tri but rather a headmodel.bnd.tri. Don’t know if it makes any difference. Perhaps the sourcespace defined in the tutorial is something different?
>
> Thank you,
>
> Emilie
>
> <ft_sourcemovie.png><leadfield.png><ft_plot_mesh.png>
>
> CODE
>
> q=biosim64;
> ph = cell2mat(q(:,2));
> th = cell2mat(q(:,3));
> x = sin(ph*pi/180) .* cos(th*pi/180);
> y = sin(ph*pi/180) .* sin(th*pi/180);
> z = cos(ph*pi/180);
>
> plot3(x, y, z, '.');
> elec.label = q(:,1);
> elec.pnt = [x y z];
>
> cfg.sourcemodel.pos = elec.pnt;
> sourcemodel = ft_prepare_sourcemodel(cfg);
>
> headmodel = ft_read_headmodel('headmodel/standard_bem.mat');
>
> % realign electrodes to headmodel
> cfg = [];
> cfg.method = 'interactive';
> cfg.elec = elec;
> cfg.headshape = headmodel.bnd(1); %1 = skin
> elec = ft_electroderealign(cfg);
>
> %save new electrodes
> save elec64.mat elec
>
> ERPsAll.elec = ft_read_sens('elec64.mat’);
>
> % Prepare leadfield
> cfg                 = [];
> cfg.elec            = ERPsAll.elec;
> cfg.vol             = headmodel;
> cfg.reducerank      = 3;
> cfg.grid.resolution = 1;   % use a 3-D grid with a 1 cm resolution
> cfg.grid.unit       = 'cm';
> cfg.channel ={'all'};
> leadfield = ft_prepare_leadfield(cfg);
>
>
>
> %%mne
> cfg              = [];
> cfg.method       = 'mne'; %pcc: partial cannonical correlation/coherence
> cfg.elec         = ERPsAll.elec; %grid.cfg.elec;%
> cfg.headmodel          = headmodel;
> cfg.grid = leadfield;
> %cfg.sourcemodel = sourcemodel;
> % cfg.channel ={'all'};%, '-spmnas', '-spmlpa', '-spmrpa'};
> cfg.mne.prewhiten = 'yes';
> cfg.mne.lambda    = 3;
> cfg.mne.scalesourcecov = 'yes';
> %cfg.reducerank          = 2;
>
> source_C_Shock = ft_sourceanalysis(cfg, GA_C_Shock);
> source_C_Noshock = ft_sourceanalysis(cfg, GA_C_NOshock);
>
> save source_C_Shock.mat source_C_Shock
> save source_C_Noshock.mat source_C_Noshock
>
> bnd.pos = headmodel.bnd.pos;
> bnd.tri = headmodel.bnd.tri;
>
> m=source_C_Shock.avg.pow(:,450);
> %timeN1 = [1232:1301];timeP3 = [1722:1927];timeeLPP = [1928:2356];timelLPP = [2357:2868];
> ft_plot_mesh(bnd, 'vertexcolor', m);
> view([180 0]); h = light; set(h, 'position', [0 1 0.2]); lighting gouraud; material dull
>
> cfg = [];
> cfg.projectmom = 'yes';
> sdShock  = ft_sourcedescriptives(cfg,source_C_Shock);
> sdNoShock = ft_sourcedescriptives(cfg,source_C_Noshock);
>
> sdDIFF         = sdNoShock;
> sdDIFF.avg.pow = sdNoShock.avg.pow - sdShock.avg.pow;
> sdDIFF.tri = headmodel.bnd.tri;
>
> save sd sdDIFF;
>
> cfg = [];
> cfg.funparameter = 'pow';
> %cfg.method       = 'surface';
> ft_sourcemovie(cfg,sdDIFF);
>
>
> ---------------------------------------------
> Emilie Caspar, Ph.D
>
> CO3, Centre de Recherche Cognition et Neurosciences (CRCN), ULB
> Voice : +32 2 650 32 95
> mail : ecaspar at ulb.ac.be
> office: DB10-138
>
> Social Brain Lab, Netherlands Institute for Neuroscience (NIN), KNAW
> mail : e.caspar at nin.knaw.nl
>
> _______________________________________________
> 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



From rpriefer at adelphi.edu  Tue Mar 31 21:06:24 2020
From: rpriefer at adelphi.edu (Ryan Priefer)
Date: Tue, 31 Mar 2020 15:06:24 -0400
Subject: [FieldTrip] Issue with reading in .mff data
Message-ID: <CAHto=chHHZdWmU=9Rdyb2Tm2g=NhuDvBgbChthrn3S1Dn9ijng@mail.gmail.com>

Hello all,

I am having some further issues reading in my .mff data into fieldtrip. I
feel I am getting close but some errors still seem to pop up. The
conditions we wish to look at within our data are labeled "2bst" and "2gdv"
via E-Prime. The sampling rate is 500. I can provide more information if
need be. I will give a brief summary of what I am doing up to this point of
error:

clear all;                                      % Remove variables from
workspace

close all;                                      % Close all open figures

ft_defaults;                                    % Include only necessary
subfolders



hdr = ft_read_header('/Applications/MATLAB_Plugins/AV2_AV.mff');

dat = ft_read_data('/Applications/MATLAB_Plugins/AV2_AV.mff');

event = ft_read_event('/Applications/MATLAB_Plugins/AV2_AV.mff') %Displays
some information


After completing this step, I am able to call upon the header, data, and
events with no issue. I can see my different triggers within different
events, and so on. At this point, following some walkthroughs on the
website, it seems I am also able to "segment" or look at the data with the
following code:

 hdr = ft_read_header('AV2_AV.mff');

event = ft_read_event('AV2_AV.mff');

sel = [];

for i=1:length(event)

  % test each event, we are looking for a trigger with value 4

  if isequal(event(i).type, 'trigger') && isequal(event(i).value, '2bst')

    sel = [sel; i];

  end

end

sel = sel(1); % select only the first trigger that was found

begsample = event(sel(1)).sample - 0.1*hdr.Fs; % select 100ms before the
sample of the trigger

endsample = event(sel(1)).sample + 0.6*hdr.Fs; % select 600ms after the
sample of the trigger

dat = ft_read_data('AV2_AV.mff', 'begsample', begsample, 'endsample',
endsample);


I figured there would be some error here, as there is a lot going on and I
am not very skilled at this. I receive an "Index exceeds number of array
elements (0)" error.

An alternative way of doing this perhaps (provided in a script by a
colleague) is the following code:

cfg = [];

cfg.datafile = '/Applications/MATLAB_Plugins/AV2_AV.mff';

cfg.trialdef.eventtype = 'trigger'; %'?' for list

cfg.trialdef.eventvalue = {'2bst' '2gdv'};

cfg.trialdef.prestim = .1;

cfg.trialdef.poststim = .6;

cfg.trialfun = 'ft_trialfun_general';



cfg = ft_definetrial(cfg);

The error I receive here is "Error using ft_definetrial (line 196)
no trials were defined, see FT_DEFINETRIAL for help"

I am unsure what this means exactly. Prior to this, I am able to call upon
individual events and therefore I know the data is read in at least
partially. I can't seem to run anything else before ft_definetrial is
completed. Ultimately, our goal is to either process within fieldtrip to
perform a cluster-based permutation test on the data- alternatively, we
could read in an already processed file. However I believe I read averaged
.mff files cannot be read in properly? I may be wrong.

Many thanks,

-- 
Ryan Priefer
Lab Technical Coordinator
Communication Sciences and Disorders
t: 516.877.6787
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/85b9be5b/attachment.htm>

