[FieldTrip] ITC

Jaishree Jalewa Jaishree.Jalewa at uon.edu.au
Wed Aug 12 13:00:01 CEST 2020


Dear Julian,

Thank you very much for all your help.

Regards,
Jaishree


________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Julian Keil <julian.keil at gmail.com>
Sent: Wednesday, 12 August 2020 7:20 PM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] ITC

Dear Jaishree,

as your question regarding how to get your own data into FieldTrip is concerned with the basics of the logic behind the FieldTrip data structure, I suggest taking a look at the tutorials provided on the website. This will allow you to get a feel for the meaning behind the structures described in your code.

http://www.fieldtriptoolbox.org/video/<http://www.fieldtriptoolbox.org/video/>
http://www.fieldtriptoolbox.org/walkthrough/<http://www.fieldtriptoolbox.org/walkthrough/>

If you have problems reading in the .set-data (I assumed it’s coming from EEGLab, which uses .set-files), you can also take a look at this reference page.

http://www.fieldtriptoolbox.org/reading_data/<http://www.fieldtriptoolbox.org/reading_data/>
http://www.fieldtriptoolbox.org/example/getting_started_with_reading_raw_eeg_or_meg_data/<http://www.fieldtriptoolbox.org/example/getting_started_with_reading_raw_eeg_or_meg_data/>

Hope this helps,

Julian


Am 12.08.2020 um 10:41 schrieb Jaishree Jalewa <Jaishree.Jalewa at uon.edu.au<mailto:Jaishree.Jalewa at uon.edu.au>>:

Dear Julian,

Many thanks for getting back to me.

Sorry to bother you again but can I humbly request you to please have a look at the script below as I am unable to run this script. The script that is provided on the link defines 'data' as a simulation I believe, but I am trying out with one preprocessed real rat EEG data file (x.set) (I have little knowledge of programming), not sure how to define data and trials (can it take the number of trials from the file or do I need to mention):
cfg        = [];
load data = 'x.set';
filename = 'x.set';
%cfg.numtrl = 100
%data       = ft_freqsimulation(cfg.data); % simulate some data
dat = ft_read_data(filename, ...);



cfg        = [];
cfg.method = 'wavelet';
cfg.toi    = [-0.1 0.3];
cfg.foi    = [1 100];
cfg.output = 'fourier';
freq       = ft_freqanalysis(cfg, data);



% make a new FieldTrip-style data structure containing the ITC
% copy the descriptive fields over from the frequency decomposition



itc           = [];
itc.label     = freq.label;
itc.freq      = freq.freq;
itc.time      = freq.time;
itc.dimord    = 'chan_freq_time';





F = freq.fourierspctrm;   % copy the Fourier spectrum
N = size(F,1);           % number of trials



% compute inter-trial phase coherence (itpc)
itc.itpc      = F./abs(F);         % divide by amplitude
itc.itpc      = sum(itc.itpc,1);   % sum angles
itc.itpc      = abs(itc.itpc)/N;   % take the absolute value and normalize
itc.itpc      = squeeze(itc.itpc); % remove the first singleton dimension



% compute inter-trial linear coherence (itlc)
itc.itlc      = sum(F) ./ (sqrt(N*sum(abs(F).^2)));
itc.itlc      = abs(itc.itlc);     % take the absolute value, i.e. ignore phase
itc.itlc      = squeeze(itc.itlc); % remove the first singleton dimension



figure
subplot(2, 1, 1);
imagesc(itc.time, itc.freq, squeeze(itc.itpc(1,:,:)));
axis xy
title('inter-trial phase coherence');
subplot(2, 1, 2);
imagesc(itc.time, itc.freq, squeeze(itc.itlc(1,:,:)));
axis xy
title('inter-trial linear coherence');

Once again sorry to bother you,

Thanks,
Jaishree
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Julian Keil <julian.keil at gmail.com<mailto:julian.keil at gmail.com>>
Sent: Wednesday, 12 August 2020 5:28 PM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] ITC

Dear Jaishree,

you can find information on how to compute ITC in FieldTrip here: http://www.fieldtriptoolbox.org/faq/itc/<http://www.fieldtriptoolbox.org/faq/itc/>
You should be able to read in the .set files using ft_read_data: http://www.fieldtriptoolbox.org/faq/dataformat/<http://www.fieldtriptoolbox.org/faq/dataformat/>

Hope this helps,

Julian

________________
Prof. Dr. Julian Keil

Biological Psychology
Olshausenstrasse 62 - R. 306
24118 Kiel, Germany

+49 - 0431 - 880 - 4872
http://www.biopsych.uni-kiel.de/en<http://www.biopsych.uni-kiel.de/en>

Am 12.08.2020 um 04:56 schrieb Jaishree Jalewa <Jaishree.Jalewa at uon.edu.au<mailto:Jaishree.Jalewa at uon.edu.au>>:

Hi, Can I please request some help with performing ITC using Fieldtrip as I have no experience with it.
I am willing to use preprocessed rat EEG data with multiple groups and conditions involved.  Can anyone please let me know how to load the .set files in order to run the Fieldtrip script.

Any help will be much appreciated.
Thanks,
Jaishree
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
https://doi.org/10.1371/journal.pcbi.1002202<https://doi.org/10.1371/journal.pcbi.1002202>

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

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


More information about the fieldtrip mailing list