SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

Similar a 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
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 DsQundeel
 
Data Structure
Data StructureData Structure
Data Structuresheraz1
 
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 a 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
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Data Structure
Data StructureData Structure
Data Structure
 
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
 

Más de 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
 

Más de 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
 

Último

PHOTOSYNTHETIC BACTERIA (OXYGENIC AND ANOXYGENIC)
PHOTOSYNTHETIC BACTERIA  (OXYGENIC AND ANOXYGENIC)PHOTOSYNTHETIC BACTERIA  (OXYGENIC AND ANOXYGENIC)
PHOTOSYNTHETIC BACTERIA (OXYGENIC AND ANOXYGENIC)kushbuR
 
NUMERICAL Proof Of TIme Electron Theory.
NUMERICAL Proof Of TIme Electron Theory.NUMERICAL Proof Of TIme Electron Theory.
NUMERICAL Proof Of TIme Electron Theory.syedmuneemqadri
 
SaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptx
SaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptxSaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptx
SaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptxPat (JS) Heslop-Harrison
 
GBSN - Biochemistry (Unit 8) Enzymology
GBSN - Biochemistry (Unit 8) EnzymologyGBSN - Biochemistry (Unit 8) Enzymology
GBSN - Biochemistry (Unit 8) EnzymologyAreesha Ahmad
 
In-pond Race way systems for Aquaculture (IPRS).pptx
In-pond Race way systems for Aquaculture (IPRS).pptxIn-pond Race way systems for Aquaculture (IPRS).pptx
In-pond Race way systems for Aquaculture (IPRS).pptxMAGOTI ERNEST
 
Biochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptx
Biochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptxBiochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptx
Biochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptxjayabahari688
 
GBSN - Microbiology (Unit 6) Human and Microbial interaction
GBSN - Microbiology (Unit 6) Human and Microbial interactionGBSN - Microbiology (Unit 6) Human and Microbial interaction
GBSN - Microbiology (Unit 6) Human and Microbial interactionAreesha Ahmad
 
POST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptx
POST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptxPOST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptx
POST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptxArpitaMishra69
 
Continuum emission from within the plunging region of black hole discs
Continuum emission from within the plunging region of black hole discsContinuum emission from within the plunging region of black hole discs
Continuum emission from within the plunging region of black hole discsSérgio Sacani
 
Factor Causing low production and physiology of mamary Gland
Factor Causing low production and physiology of mamary GlandFactor Causing low production and physiology of mamary Gland
Factor Causing low production and physiology of mamary GlandRcvets
 
Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...
Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...
Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...yogeshlabana357357
 
VILLAGE ATTACHMENT For rural agriculture PPT.pptx
VILLAGE ATTACHMENT For rural agriculture  PPT.pptxVILLAGE ATTACHMENT For rural agriculture  PPT.pptx
VILLAGE ATTACHMENT For rural agriculture PPT.pptxAQIBRASOOL4
 
Information science research with large language models: between science and ...
Information science research with large language models: between science and ...Information science research with large language models: between science and ...
Information science research with large language models: between science and ...Fabiano Dalpiaz
 
Introduction and significance of Symbiotic algae
Introduction and significance of  Symbiotic algaeIntroduction and significance of  Symbiotic algae
Introduction and significance of Symbiotic algaekushbuR
 
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 RpWASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 RpSérgio Sacani
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
 
Manganese‐RichSandstonesasanIndicatorofAncientOxic LakeWaterConditionsinGale...
Manganese‐RichSandstonesasanIndicatorofAncientOxic  LakeWaterConditionsinGale...Manganese‐RichSandstonesasanIndicatorofAncientOxic  LakeWaterConditionsinGale...
Manganese‐RichSandstonesasanIndicatorofAncientOxic LakeWaterConditionsinGale...Sérgio Sacani
 
Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...
Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...
Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...Sérgio Sacani
 
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...kevin8smith
 
Triploidy ...............................pptx
Triploidy ...............................pptxTriploidy ...............................pptx
Triploidy ...............................pptxCherry
 

Último (20)

PHOTOSYNTHETIC BACTERIA (OXYGENIC AND ANOXYGENIC)
PHOTOSYNTHETIC BACTERIA  (OXYGENIC AND ANOXYGENIC)PHOTOSYNTHETIC BACTERIA  (OXYGENIC AND ANOXYGENIC)
PHOTOSYNTHETIC BACTERIA (OXYGENIC AND ANOXYGENIC)
 
NUMERICAL Proof Of TIme Electron Theory.
NUMERICAL Proof Of TIme Electron Theory.NUMERICAL Proof Of TIme Electron Theory.
NUMERICAL Proof Of TIme Electron Theory.
 
SaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptx
SaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptxSaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptx
SaffronCrocusGenomicsThessalonikiOnlineMay2024TalkOnline.pptx
 
GBSN - Biochemistry (Unit 8) Enzymology
GBSN - Biochemistry (Unit 8) EnzymologyGBSN - Biochemistry (Unit 8) Enzymology
GBSN - Biochemistry (Unit 8) Enzymology
 
In-pond Race way systems for Aquaculture (IPRS).pptx
In-pond Race way systems for Aquaculture (IPRS).pptxIn-pond Race way systems for Aquaculture (IPRS).pptx
In-pond Race way systems for Aquaculture (IPRS).pptx
 
Biochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptx
Biochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptxBiochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptx
Biochemistry and Biomolecules - Science - 9th Grade by Slidesgo.pptx
 
GBSN - Microbiology (Unit 6) Human and Microbial interaction
GBSN - Microbiology (Unit 6) Human and Microbial interactionGBSN - Microbiology (Unit 6) Human and Microbial interaction
GBSN - Microbiology (Unit 6) Human and Microbial interaction
 
POST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptx
POST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptxPOST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptx
POST TRANSCRIPTIONAL GENE SILENCING-AN INTRODUCTION.pptx
 
Continuum emission from within the plunging region of black hole discs
Continuum emission from within the plunging region of black hole discsContinuum emission from within the plunging region of black hole discs
Continuum emission from within the plunging region of black hole discs
 
Factor Causing low production and physiology of mamary Gland
Factor Causing low production and physiology of mamary GlandFactor Causing low production and physiology of mamary Gland
Factor Causing low production and physiology of mamary Gland
 
Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...
Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...
Soil and Water Conservation Engineering (SWCE) is a specialized field of stud...
 
VILLAGE ATTACHMENT For rural agriculture PPT.pptx
VILLAGE ATTACHMENT For rural agriculture  PPT.pptxVILLAGE ATTACHMENT For rural agriculture  PPT.pptx
VILLAGE ATTACHMENT For rural agriculture PPT.pptx
 
Information science research with large language models: between science and ...
Information science research with large language models: between science and ...Information science research with large language models: between science and ...
Information science research with large language models: between science and ...
 
Introduction and significance of Symbiotic algae
Introduction and significance of  Symbiotic algaeIntroduction and significance of  Symbiotic algae
Introduction and significance of Symbiotic algae
 
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 RpWASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
WASP-69b’s Escaping Envelope Is Confined to a Tail Extending at Least 7 Rp
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Manganese‐RichSandstonesasanIndicatorofAncientOxic LakeWaterConditionsinGale...
Manganese‐RichSandstonesasanIndicatorofAncientOxic  LakeWaterConditionsinGale...Manganese‐RichSandstonesasanIndicatorofAncientOxic  LakeWaterConditionsinGale...
Manganese‐RichSandstonesasanIndicatorofAncientOxic LakeWaterConditionsinGale...
 
Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...
Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...
Extensive Pollution of Uranus and Neptune’s Atmospheres by Upsweep of Icy Mat...
 
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
Harry Coumnas Thinks That Human Teleportation is Possible in Quantum Mechanic...
 
Triploidy ...............................pptx
Triploidy ...............................pptxTriploidy ...............................pptx
Triploidy ...............................pptx
 

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