Behavioral Disorder: Schizophrenia & it's Case Study.pdf
FieldTrip tutorial at WIRED20204 in Paris
1. FieldTrip for the analysis of
iEEG (ECoG and SEEG) data
Robert Oostenveld
Donders Institute, Radboud University, Nijmegen, NL
NatMEG, Karolinska Institute, Stockholm, SE
2. What is FieldTrip
a MATLAB toolbox for the analysis of MEG, EEG
and invasively recorded electrophysiology data
can import data from many different file formats
contains algorithms for timeseries analysis,
spectral analysis, anatomical processing,
connectivity, statistics, …
3. How do we record signals from healthy participants
4. How do we analyze signals from healthy participants
EEG channels are comparable over participants
(within a study) and spatially quite blurry,
hence often channel-level analysis
MEG has better spatial resolution and the position
of the head varies between participants, hence
often source reconstruction and analysis+stats
at the brain level
5. How do we analyze iEEG signals
Intracranial EEG (both sEEG and ECoG) is
recorded in the brain, hence channel level is at
the brain level.
However, different implantation schemes over
participants and incomplete coverage.
Anatomical processing is more elaborate than with
EEG and MEG.
Anatomical labeling of the channels is used to
combine data over participants
9. Using functions in an analysis protocol
ft_preprocessing
ft_rejectartifact
ft_freqanalysis
ft_multiplotTFR ft_freqstatistics
ft_multiplotTFR
FT_PREPROCESSING reads MEG and/or EEG data according to user-specified
trials and applies several user-specified preprocessing steps to the
signals.
Use as
[data] = ft_preprocessing(cfg)
or
[data] = ft_preprocessing(cfg, data)
The first input argument "cfg" is the configuration structure, which
contains all details for the dataset filenames, trials and the
preprocessing options. You can only do preprocessing after defining the
segments of data to be read from the file (i.e. the trials), which is for
example done based on the occurence of a trigger in the data.
...
10. Using functions in an analysis protocol
ft_preprocessing
ft_rejectartifact
ft_freqanalysis
ft_multiplotTFR ft_freqstatistics
ft_multiplotTFR
cfg = [ ]
cfg.dataset = ‘Subject01.ds’
cfg.bpfilter = [0.01 150]
...
rawdata = ft_preprocessing(cfg)
11. Using functions in an analysis protocol
ft_preprocessing
ft_rejectartifact
ft_freqanalysis
ft_multiplotTFR ft_freqstatistics
ft_multiplotTFR
cfg = [ ]
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
...
freqdata = ft_freqanalysis(cfg, rawdata)
19. Example use in scripts
subj = {‘S01.ds’, ‘S02.ds’, …}
trig = [1 3 7 9]
for s=1:nsubj
for c=1:ncond
cfg = []
cfg.dataset = subj{s}
cfg.trigger = trig(c)
rawdata{s,c} = ft_preprocessing(cfg)
cfg = []
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
freqdata{s,c} = ft_freqanalysis(cfg, rawdata{s,c})
end
end
20. Example use in scripts
subj = {‘S01.ds’, ‘S02.ds’, …}
trig = [1 3 7 9]
for s=1:nsubj
for c=1:ncond
cfg = []
cfg.dataset = subj{s}
cfg.trigger = trig(c)
rawdata = ft_preprocessing(cfg)
filename = sprintf(‘raw%s_%d.mat’, subj{s}, trig(c));
save(filename, ‘rawdata’)
end
end
21. FieldTrip is a toolbox
the data and the separate functions are in
your hands
the scripts depend on the data properties,
your computer and on your programming
skills and style
scripts correspond to analysis protocols
scripts can be reviewed by supervisors
scripts are often shared with colleagues
scripts can be published/released
23. Example organization within a script
%% details_sub01
datafile = ...
mrifile = ...
condition = {‘vis’, ’aud’}
trigger = [37 48];
%% do_preprocessing
subjid = ’sub01’;
eval([details subjid])
do_step1 = true;
do_step2 = false;
do_step3 = false;
if do_step1
cfg = [];
cfg = ...
data = ft_preprpocessing(cfg)
save(...)
end
if do_step2
load(...)
...
end
24. Finding your way around in the FieldTrip toolbox
Matlab
help functionname
edit functionname, e.g., edit ft_preprocessing
Website
http://www.fieldtriptoolbox.org
Email discussion list
Expertise in your local group
25. Zooming out a bit…
More tutorials available on
https://www.fieldtriptoolbox.org/tutorial
Video lectures available on
https://www.fieldtriptoolbox.org/video
What is BIDS and some relevant papers to read...
26. What is BIDS?
BIDS is a way to organize your existing raw data
To improve consistent and complete documentation
To facilitate re-use by your future self and others
http://bids.neuroimaging.io