SlideShare a Scribd company logo
1 of 29
FieldTrip for the analysis of
iEEG (ECoG and SEEG) data
Robert Oostenveld
Donders Institute, Radboud University, Nijmegen, NL
NatMEG, Karolinska Institute, Stockholm, SE
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, …
How do we record signals from healthy participants
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
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
iEEG pipeline
Some FieldTrip basics
dataout = functionname(cfg, datain, …)
functionname(cfg, datain, …)
dataout = functionname(cfg)
the “cfg” argument is a configuration structure, e.g.
cfg.channel = {‘C3’, C4’, ‘F3’, ‘F4’}
cfg.foilim = [1 70]
FieldTrip v.s. default Matlab
dataout = functionname(cfg, datain, …)
dataout = functionname(datain, key1, value1, …)
cfg.key1 = value1
cfg.key2 = value2
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.
...
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)
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)
Raw data structure
rawData =
label: {151x1 cell}
trial: {1x80 cell}
time: {1x80 cell}
fsample: 300
hdr: [1x1 struct]
cfg: [1x1 struct]
Event related response
timelockData =
label: {151x1 cell}
avg: [151x900 double]
var: [151x900 double]
time: [1x900 double]
dimord: 'chan_time’
cfg: [1x1 struct]
Example use in scripts
cfg = []
cfg.dataset = ‘Subject01.ds’
cfg.bpfilter = [0.01 150]
...
rawdata = ft_preprocessing(cfg)
cfg = []
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
...
freqdata = ft_freqanalysis(cfg, rawdata)
cfg = []
cfg.method = ‘montecarlo’
cfg.statistic = ‘indepsamplesT’
cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ]
...
freqstat = ft_freqstatistics(cfg, freqdata)
ft_preprocessing
ft_freqanalysis
ft_freqstatistics
ft_topoplotTFR
…
Example use in scripts
cfg = []
cfg.dataset = ‘Subject01.ds’
cfg.bpfilter = [0.01 150]
...
rawdata = ft_preprocessing(cfg)
cfg = []
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
...
freqdata = ft_freqanalysis(cfg, rawdata)
cfg = []
cfg.method = ‘montecarlo’
cfg.statistic = ‘indepsamplesT’
cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ]
...
freqstat = ft_freqstatistics(cfg, freqdata)
ft_preprocessing
ft_freqanalysis
ft_freqstatistics
ft_topoplotTFR
…
Example use in scripts
cfg = []
cfg.dataset = ‘Subject01.ds’
cfg.bpfilter = [0.01 150]
...
rawdata = ft_preprocessing(cfg)
cfg = []
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
...
freqdata = ft_freqanalysis(cfg, rawdata)
cfg = []
cfg.method = ‘montecarlo’
cfg.statistic = ‘indepsamplesT’
cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ]
...
freqstat = ft_freqstatistics(cfg, freqdata)
ft_preprocessing
ft_freqanalysis
ft_freqstatistics
ft_topoplotTFR
…
Example use in scripts
cfg = []
cfg.dataset = ‘Subject01.ds’
cfg.bpfilter = [0.01 150]
...
rawdata = ft_preprocessing(cfg)
cfg = []
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
...
freqdata = ft_freqanalysis(cfg, rawdata)
cfg = []
cfg.method = ‘montecarlo’
cfg.statistic = ‘indepsamplesT’
cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ]
...
freqstat = ft_freqstatistics(cfg, freqdata)
ft_preprocessing
ft_freqanalysis
ft_freqstatistics
ft_topoplotTFR
…
Example use in scripts
cfg = []
cfg.dataset = ‘Subject01.ds’
cfg.bpfilter = [0.01 150]
...
rawdata = ft_preprocessing(cfg)
cfg = []
cfg.method = ‘mtmfft’
cfg.foilim = [1 120]
...
freqdata = ft_freqanalysis(cfg, rawdata)
cfg = []
cfg.method = ‘montecarlo’
cfg.statistic = ‘indepsamplesT’
cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ]
...
freqstat = ft_freqstatistics(cfg, freqdata)
ft_preprocessing
ft_freqanalysis
ft_freqstatistics
ft_topoplotTFR
…
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
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
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
Example organization over multiple scripts
preprocess_sub01.m
preprocess_sub02.m
preprocess_sub03.m
...
anatomical_sub01.m
anatomical_sub02.m
anatomical_sub03.m
...
analysis_pipeline_RQ1.m
analysis_pipeline_RQ2.m
...
https://www.frontiersin.org/research-topics/5158/from-raw-
megeeg-to-publication-how-to-perform-megeeg-group-analysis-
with-free-academic-software
https://github.com/robertoostenveld/Wakeman-and-Henson-2015
details_sub01.m
details_sub02.m
details_sub03.m
...
do_preprocess.m
do_anatomical.m
analysis_pipeline_RQ1.m
analysis_pipeline_RQ2.m
...
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
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
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...
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
FieldTrip tutorial at WIRED20204 in Paris
FieldTrip tutorial at WIRED20204 in Paris
FieldTrip tutorial at WIRED20204 in Paris

More Related Content

Similar to FieldTrip tutorial at WIRED20204 in Paris

20181212 - PGconfASIA - LT - English
20181212 - PGconfASIA - LT - English20181212 - PGconfASIA - LT - English
20181212 - PGconfASIA - LT - EnglishKohei KaiGai
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubJeongkyu Shin
 
Trelles_QnormBOSC2009
Trelles_QnormBOSC2009Trelles_QnormBOSC2009
Trelles_QnormBOSC2009bosc
 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel ProgrammingAhmed Mekkawy
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisFastly
 
Introduction to datastructure and algorithm
Introduction to datastructure and algorithmIntroduction to datastructure and algorithm
Introduction to datastructure and algorithmPratik Mota
 
Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...
Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...
Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...gdgsurrey
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptxKarthikVijay59
 
Cloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceCloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceOrgad Kimchi
 
Kapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing EngineKapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing EnginePrashant Vats
 
Inference accelerators
Inference acceleratorsInference accelerators
Inference acceleratorsDarshanG13
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 DsQundeel
 
Data Structure
Data StructureData Structure
Data Structuresheraz1
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 DsQundeel
 
Statistical inference for (Python) Data Analysis. An introduction.
Statistical inference for (Python) Data Analysis. An introduction.Statistical inference for (Python) Data Analysis. An introduction.
Statistical inference for (Python) Data Analysis. An introduction.Piotr Milanowski
 
Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...
Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...
Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...Flink Forward
 
Regression and Classification with R
Regression and Classification with RRegression and Classification with R
Regression and Classification with RYanchang Zhao
 

Similar to FieldTrip tutorial at WIRED20204 in Paris (20)

Writing Faster Python 3
Writing Faster Python 3Writing Faster Python 3
Writing Faster Python 3
 
20181212 - PGconfASIA - LT - English
20181212 - PGconfASIA - LT - English20181212 - PGconfASIA - LT - English
20181212 - PGconfASIA - LT - English
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow Hub
 
Trelles_QnormBOSC2009
Trelles_QnormBOSC2009Trelles_QnormBOSC2009
Trelles_QnormBOSC2009
 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel Programming
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Introduction to datastructure and algorithm
Introduction to datastructure and algorithmIntroduction to datastructure and algorithm
Introduction to datastructure and algorithm
 
Profiling in Python
Profiling in PythonProfiling in Python
Profiling in Python
 
Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...
Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...
Certification Study Group -Professional ML Engineer Session 2 (GCP-TensorFlow...
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
 
Cloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTraceCloud Observation and Performance Analysis using Solaris 11 DTrace
Cloud Observation and Performance Analysis using Solaris 11 DTrace
 
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop  - Xi...
PMED Undergraduate Workshop - R Tutorial for PMED Undegraduate Workshop - Xi...
 
Kapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing EngineKapacitor - Real Time Data Processing Engine
Kapacitor - Real Time Data Processing Engine
 
Inference accelerators
Inference acceleratorsInference accelerators
Inference accelerators
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Data Structure
Data StructureData Structure
Data Structure
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Statistical inference for (Python) Data Analysis. An introduction.
Statistical inference for (Python) Data Analysis. An introduction.Statistical inference for (Python) Data Analysis. An introduction.
Statistical inference for (Python) Data Analysis. An introduction.
 
Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...
Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...
Flink Forward San Francisco 2019: TensorFlow Extended: An end-to-end machine ...
 
Regression and Classification with R
Regression and Classification with RRegression and Classification with R
Regression and Classification with R
 

More from Robert Oostenveld

Developing and sharing tools for bioelectromagnetic research
Developing and sharing tools for bioelectromagnetic researchDeveloping and sharing tools for bioelectromagnetic research
Developing and sharing tools for bioelectromagnetic researchRobert Oostenveld
 
Connecting GLIMR with the BIDS initiative
Connecting GLIMR with the BIDS initiativeConnecting GLIMR with the BIDS initiative
Connecting GLIMR with the BIDS initiativeRobert Oostenveld
 
Spectral-, source-, connectivity- and network analysis of EEG and MEG data
Spectral-, source-, connectivity- and network analysis of EEG and MEG dataSpectral-, source-, connectivity- and network analysis of EEG and MEG data
Spectral-, source-, connectivity- and network analysis of EEG and MEG dataRobert Oostenveld
 
Donders neuroimage toolkit - open science and good practices
Donders neuroimage toolkit -  open science and good practicesDonders neuroimage toolkit -  open science and good practices
Donders neuroimage toolkit - open science and good practicesRobert Oostenveld
 
Using Open Science to advance science - advancing open data
Using Open Science to advance science - advancing open data Using Open Science to advance science - advancing open data
Using Open Science to advance science - advancing open data Robert Oostenveld
 
OHBM 2020 OSR - Brain research data sharing and personal data privacy
OHBM 2020 OSR - Brain research data sharing and personal data privacyOHBM 2020 OSR - Brain research data sharing and personal data privacy
OHBM 2020 OSR - Brain research data sharing and personal data privacyRobert Oostenveld
 
The Brain Imaging Data Structure and its use for fNIRS
The Brain Imaging Data Structure and its use for fNIRSThe Brain Imaging Data Structure and its use for fNIRS
The Brain Imaging Data Structure and its use for fNIRSRobert Oostenveld
 
Organizing EEG data using the Brain Imaging Data Structure
Organizing EEG data using the Brain Imaging Data Structure Organizing EEG data using the Brain Imaging Data Structure
Organizing EEG data using the Brain Imaging Data Structure Robert Oostenveld
 
BIOMAG2018 - Denis Engemann - MNE-HCP
BIOMAG2018 - Denis Engemann - MNE-HCPBIOMAG2018 - Denis Engemann - MNE-HCP
BIOMAG2018 - Denis Engemann - MNE-HCPRobert Oostenveld
 
BIOMAG2018 - Tzvetan Popov - HCP from a user's perspective
BIOMAG2018 - Tzvetan Popov - HCP from a user's perspectiveBIOMAG2018 - Tzvetan Popov - HCP from a user's perspective
BIOMAG2018 - Tzvetan Popov - HCP from a user's perspectiveRobert Oostenveld
 
BIOMAG2018 - Vladimir Litvak - Frontiers
BIOMAG2018 - Vladimir Litvak - FrontiersBIOMAG2018 - Vladimir Litvak - Frontiers
BIOMAG2018 - Vladimir Litvak - FrontiersRobert Oostenveld
 
BIOMAG2018 - Jan-Mathijs Schoffelen - COBIDAS
BIOMAG2018 - Jan-Mathijs Schoffelen - COBIDASBIOMAG2018 - Jan-Mathijs Schoffelen - COBIDAS
BIOMAG2018 - Jan-Mathijs Schoffelen - COBIDASRobert Oostenveld
 
BIOMAG2018 - Darren Price - CamCAN
BIOMAG2018 - Darren Price - CamCANBIOMAG2018 - Darren Price - CamCAN
BIOMAG2018 - Darren Price - CamCANRobert Oostenveld
 
CuttingEEG - Open Science, Open Data and BIDS for EEG
CuttingEEG - Open Science, Open Data and BIDS for EEGCuttingEEG - Open Science, Open Data and BIDS for EEG
CuttingEEG - Open Science, Open Data and BIDS for EEGRobert Oostenveld
 
ChildBrain/Predictable summer school - Open Science
ChildBrain/Predictable summer school - Open Science ChildBrain/Predictable summer school - Open Science
ChildBrain/Predictable summer school - Open Science Robert Oostenveld
 
Using Open Science to accelerate advancements in auditory EEG signal processing
Using Open Science to accelerate advancements in auditory EEG signal processingUsing Open Science to accelerate advancements in auditory EEG signal processing
Using Open Science to accelerate advancements in auditory EEG signal processingRobert Oostenveld
 
Donders Repository - removing barriers for management and sharing of research...
Donders Repository - removing barriers for management and sharing of research...Donders Repository - removing barriers for management and sharing of research...
Donders Repository - removing barriers for management and sharing of research...Robert Oostenveld
 
RDM and the Donders Repository
RDM and the Donders RepositoryRDM and the Donders Repository
RDM and the Donders RepositoryRobert Oostenveld
 
Donders Research Data Repository
Donders Research Data Repository Donders Research Data Repository
Donders Research Data Repository Robert Oostenveld
 

More from Robert Oostenveld (20)

Developing and sharing tools for bioelectromagnetic research
Developing and sharing tools for bioelectromagnetic researchDeveloping and sharing tools for bioelectromagnetic research
Developing and sharing tools for bioelectromagnetic research
 
Connecting GLIMR with the BIDS initiative
Connecting GLIMR with the BIDS initiativeConnecting GLIMR with the BIDS initiative
Connecting GLIMR with the BIDS initiative
 
Spectral-, source-, connectivity- and network analysis of EEG and MEG data
Spectral-, source-, connectivity- and network analysis of EEG and MEG dataSpectral-, source-, connectivity- and network analysis of EEG and MEG data
Spectral-, source-, connectivity- and network analysis of EEG and MEG data
 
Donders neuroimage toolkit - open science and good practices
Donders neuroimage toolkit -  open science and good practicesDonders neuroimage toolkit -  open science and good practices
Donders neuroimage toolkit - open science and good practices
 
The Donders Repository
The Donders RepositoryThe Donders Repository
The Donders Repository
 
Using Open Science to advance science - advancing open data
Using Open Science to advance science - advancing open data Using Open Science to advance science - advancing open data
Using Open Science to advance science - advancing open data
 
OHBM 2020 OSR - Brain research data sharing and personal data privacy
OHBM 2020 OSR - Brain research data sharing and personal data privacyOHBM 2020 OSR - Brain research data sharing and personal data privacy
OHBM 2020 OSR - Brain research data sharing and personal data privacy
 
The Brain Imaging Data Structure and its use for fNIRS
The Brain Imaging Data Structure and its use for fNIRSThe Brain Imaging Data Structure and its use for fNIRS
The Brain Imaging Data Structure and its use for fNIRS
 
Organizing EEG data using the Brain Imaging Data Structure
Organizing EEG data using the Brain Imaging Data Structure Organizing EEG data using the Brain Imaging Data Structure
Organizing EEG data using the Brain Imaging Data Structure
 
BIOMAG2018 - Denis Engemann - MNE-HCP
BIOMAG2018 - Denis Engemann - MNE-HCPBIOMAG2018 - Denis Engemann - MNE-HCP
BIOMAG2018 - Denis Engemann - MNE-HCP
 
BIOMAG2018 - Tzvetan Popov - HCP from a user's perspective
BIOMAG2018 - Tzvetan Popov - HCP from a user's perspectiveBIOMAG2018 - Tzvetan Popov - HCP from a user's perspective
BIOMAG2018 - Tzvetan Popov - HCP from a user's perspective
 
BIOMAG2018 - Vladimir Litvak - Frontiers
BIOMAG2018 - Vladimir Litvak - FrontiersBIOMAG2018 - Vladimir Litvak - Frontiers
BIOMAG2018 - Vladimir Litvak - Frontiers
 
BIOMAG2018 - Jan-Mathijs Schoffelen - COBIDAS
BIOMAG2018 - Jan-Mathijs Schoffelen - COBIDASBIOMAG2018 - Jan-Mathijs Schoffelen - COBIDAS
BIOMAG2018 - Jan-Mathijs Schoffelen - COBIDAS
 
BIOMAG2018 - Darren Price - CamCAN
BIOMAG2018 - Darren Price - CamCANBIOMAG2018 - Darren Price - CamCAN
BIOMAG2018 - Darren Price - CamCAN
 
CuttingEEG - Open Science, Open Data and BIDS for EEG
CuttingEEG - Open Science, Open Data and BIDS for EEGCuttingEEG - Open Science, Open Data and BIDS for EEG
CuttingEEG - Open Science, Open Data and BIDS for EEG
 
ChildBrain/Predictable summer school - Open Science
ChildBrain/Predictable summer school - Open Science ChildBrain/Predictable summer school - Open Science
ChildBrain/Predictable summer school - Open Science
 
Using Open Science to accelerate advancements in auditory EEG signal processing
Using Open Science to accelerate advancements in auditory EEG signal processingUsing Open Science to accelerate advancements in auditory EEG signal processing
Using Open Science to accelerate advancements in auditory EEG signal processing
 
Donders Repository - removing barriers for management and sharing of research...
Donders Repository - removing barriers for management and sharing of research...Donders Repository - removing barriers for management and sharing of research...
Donders Repository - removing barriers for management and sharing of research...
 
RDM and the Donders Repository
RDM and the Donders RepositoryRDM and the Donders Repository
RDM and the Donders Repository
 
Donders Research Data Repository
Donders Research Data Repository Donders Research Data Repository
Donders Research Data Repository
 

Recently uploaded

Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensorsonawaneprad
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxmalonesandreagweneth
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 
preservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxpreservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxnoordubaliya2003
 
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxGenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxBerniceCayabyab1
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsHajira Mahmood
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringPrajakta Shinde
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Nistarini College, Purulia (W.B) India
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationColumbia Weather Systems
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRlizamodels9
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfSELF-EXPLANATORY
 

Recently uploaded (20)

Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensor
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 
preservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxpreservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptx
 
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxGenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutions
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical Engineering
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather Station
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
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
  • 7. Some FieldTrip basics dataout = functionname(cfg, datain, …) functionname(cfg, datain, …) dataout = functionname(cfg) the “cfg” argument is a configuration structure, e.g. cfg.channel = {‘C3’, C4’, ‘F3’, ‘F4’} cfg.foilim = [1 70]
  • 8. FieldTrip v.s. default Matlab dataout = functionname(cfg, datain, …) dataout = functionname(datain, key1, value1, …) cfg.key1 = value1 cfg.key2 = value2
  • 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)
  • 12. Raw data structure rawData = label: {151x1 cell} trial: {1x80 cell} time: {1x80 cell} fsample: 300 hdr: [1x1 struct] cfg: [1x1 struct]
  • 13. Event related response timelockData = label: {151x1 cell} avg: [151x900 double] var: [151x900 double] time: [1x900 double] dimord: 'chan_time’ cfg: [1x1 struct]
  • 14. Example use in scripts cfg = [] cfg.dataset = ‘Subject01.ds’ cfg.bpfilter = [0.01 150] ... rawdata = ft_preprocessing(cfg) cfg = [] cfg.method = ‘mtmfft’ cfg.foilim = [1 120] ... freqdata = ft_freqanalysis(cfg, rawdata) cfg = [] cfg.method = ‘montecarlo’ cfg.statistic = ‘indepsamplesT’ cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ] ... freqstat = ft_freqstatistics(cfg, freqdata) ft_preprocessing ft_freqanalysis ft_freqstatistics ft_topoplotTFR …
  • 15. Example use in scripts cfg = [] cfg.dataset = ‘Subject01.ds’ cfg.bpfilter = [0.01 150] ... rawdata = ft_preprocessing(cfg) cfg = [] cfg.method = ‘mtmfft’ cfg.foilim = [1 120] ... freqdata = ft_freqanalysis(cfg, rawdata) cfg = [] cfg.method = ‘montecarlo’ cfg.statistic = ‘indepsamplesT’ cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ] ... freqstat = ft_freqstatistics(cfg, freqdata) ft_preprocessing ft_freqanalysis ft_freqstatistics ft_topoplotTFR …
  • 16. Example use in scripts cfg = [] cfg.dataset = ‘Subject01.ds’ cfg.bpfilter = [0.01 150] ... rawdata = ft_preprocessing(cfg) cfg = [] cfg.method = ‘mtmfft’ cfg.foilim = [1 120] ... freqdata = ft_freqanalysis(cfg, rawdata) cfg = [] cfg.method = ‘montecarlo’ cfg.statistic = ‘indepsamplesT’ cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ] ... freqstat = ft_freqstatistics(cfg, freqdata) ft_preprocessing ft_freqanalysis ft_freqstatistics ft_topoplotTFR …
  • 17. Example use in scripts cfg = [] cfg.dataset = ‘Subject01.ds’ cfg.bpfilter = [0.01 150] ... rawdata = ft_preprocessing(cfg) cfg = [] cfg.method = ‘mtmfft’ cfg.foilim = [1 120] ... freqdata = ft_freqanalysis(cfg, rawdata) cfg = [] cfg.method = ‘montecarlo’ cfg.statistic = ‘indepsamplesT’ cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ] ... freqstat = ft_freqstatistics(cfg, freqdata) ft_preprocessing ft_freqanalysis ft_freqstatistics ft_topoplotTFR …
  • 18. Example use in scripts cfg = [] cfg.dataset = ‘Subject01.ds’ cfg.bpfilter = [0.01 150] ... rawdata = ft_preprocessing(cfg) cfg = [] cfg.method = ‘mtmfft’ cfg.foilim = [1 120] ... freqdata = ft_freqanalysis(cfg, rawdata) cfg = [] cfg.method = ‘montecarlo’ cfg.statistic = ‘indepsamplesT’ cfg.design = [1 2 1 2 2 1 2 1 1 2 ... ] ... freqstat = ft_freqstatistics(cfg, freqdata) ft_preprocessing ft_freqanalysis ft_freqstatistics ft_topoplotTFR …
  • 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
  • 22. Example organization over multiple scripts preprocess_sub01.m preprocess_sub02.m preprocess_sub03.m ... anatomical_sub01.m anatomical_sub02.m anatomical_sub03.m ... analysis_pipeline_RQ1.m analysis_pipeline_RQ2.m ... https://www.frontiersin.org/research-topics/5158/from-raw- megeeg-to-publication-how-to-perform-megeeg-group-analysis- with-free-academic-software https://github.com/robertoostenveld/Wakeman-and-Henson-2015 details_sub01.m details_sub02.m details_sub03.m ... do_preprocess.m do_anatomical.m analysis_pipeline_RQ1.m analysis_pipeline_RQ2.m ...
  • 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