FieldTrip, a tool for GUI-less exploration of brain dynamics
description
Transcript of FieldTrip, a tool for GUI-less exploration of brain dynamics
![Page 1: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/1.jpg)
FieldTrip, a tool for GUI-less exploration
of brain dynamics
Jan-Mathijs Schoffelen
![Page 2: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/2.jpg)
Purpose of this talk
Advertisement• of FieldTrip• of some of the scientific work done with FieldTrip
![Page 3: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/3.jpg)
What is FieldTrip?
A MATLAB toolbox for electrophysiological data analysis
![Page 4: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/4.jpg)
Features: high-level functions forelectrophysiological data analysis
Data reading
all commercial MEG systems, many different EEG systems
Preprocessing
filtering, segmenting
Time-locked ERF analysis
Frequency and time-frequency analysis
multitapers, wavelets, welch, hilbert, parametric spectral estimates
![Page 5: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/5.jpg)
Features: high-level functions forelectrophysiological data analysis
Functional connectivity analysis
coherence, phase locking value, granger causality,
and many more
Source reconstruction
beamformers, dipole fitting, linear estimation
Statistical analysis
parametric, non-parametric, channel and source level
All other operations that are required around it
![Page 6: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/6.jpg)
But…
X
![Page 7: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/7.jpg)
Comparison with another well-known toolbox
SPM contra
buttonsmodel-based
GLM, DCM, bayesian model comparison
functionsdata-driven
![Page 8: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/8.jpg)
Comparison with another well-known toolbox
SPMintra
Under the hood a lot of the code is shared
![Page 9: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/9.jpg)
Features
Analysis steps are incorporated in functions
![Page 10: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/10.jpg)
Using functions in an analysis protocol
preprocessingpreprocessing
rejectartifactrejectartifact
freqanalysisfreqanalysis
multiplotTFRmultiplotTFR freqstatisticsfreqstatistics
multiplotTFRmultiplotTFR
cfg = [ ]cfg.dataset = ‘Subject01.ds’cfg.bpfilter = [0.01 150]...rawdata = preprocessing(cfg)
cfg = [ ]cfg.dataset = ‘Subject01.ds’cfg.bpfilter = [0.01 150]...rawdata = preprocessing(cfg)
![Page 11: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/11.jpg)
Typical functions
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]
and determines specific behaviour of the function
![Page 12: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/12.jpg)
Features
Analysis steps are incorporated in functions
Data are represented in standard MATLAB structures
as small as possible
contain all relevant details
![Page 13: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/13.jpg)
Raw data structure
rawData = label: {151x1 cell} trial: {1x87 cell} time: {1x87 cell} fsample: 300 hdr: [1x1 struct] cfg: [1x1 struct]
![Page 14: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/14.jpg)
Event related response
erpData = label: {151x1 cell} avg: [151x900 double] var: [151x900 double] time: [1x900 double] dimord: 'chan_time’ cfg: [1x1 struct]
![Page 15: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/15.jpg)
Features
Analysis steps are incorporated in functions
Data are represented in standard MATLAB structures
as small as possible
contain all relevant details
Data structures bind together analysis blocks
![Page 16: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/16.jpg)
Using functions in an analysis protocol
preprocessingpreprocessing
rejectartifactrejectartifact
freqanalysisfreqanalysis
multiplotTFRmultiplotTFR freqstatisticsfreqstatistics
multiplotTFRmultiplotTFR
cfg = [ ]cfg.method = ‘mtmfft’cfg.foilim = [1 120]...freqdata = freqanalysis(cfg, rawdata)
cfg = [ ]cfg.method = ‘mtmfft’cfg.foilim = [1 120]...freqdata = freqanalysis(cfg, rawdata)
![Page 17: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/17.jpg)
Features
Analysis steps are incorporated in functions
Data are represented in standard MATLAB structures
as small as possible
contain all relevant details
Data structures bind together analysis blocks
Easy to write new functions that operate on these data structures
Output of your own functions can be further processed or plotted with FieldTrip functions
![Page 18: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/18.jpg)
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)
……
![Page 19: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/19.jpg)
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)
……
![Page 20: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/20.jpg)
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)
……
![Page 21: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/21.jpg)
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)
![Page 22: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/22.jpg)
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)
![Page 23: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/23.jpg)
Example use in scripts
subjlist = {‘S01.ds’, ‘S02.ds’, …}triglist = [1 3 7 9]
for s=1:nsubjfor c=1:ncond
cfg = [ ] cfg.dataset = subjlist{s} cfg.trigger = triglist(c) rawdata{s,c} = preprocessing(cfg)
cfg = [ ] cfg.method = ‘mtm’ cfg.foilim = [1 120] freqdata {s,c} = freqanalysis(cfg, rawdata)
endend
![Page 24: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/24.jpg)
Example use in scripts
subjlist = {‘S01.ds’, ‘S02.ds’, …}triglist = [1 3 7 9]
for s=1:nsubjfor c=1:ncond
cfg = [ ] cfg.dataset = subjlist{s} cfg.trigger = triglist(c) rawdata{s,c} = preprocessing(cfg)
filename = sprintf(‘raw%s_%d.mat’, subjlist{s}, condlist(c)); save(filename, ‘rawdata’)
endend
![Page 25: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/25.jpg)
Relevance of analysis scripts
the data and the separate functions are in the hands of the end-users
the scripts depend on the data properties, available memory and programming skills and style
scripts correspond to analysis protocolsscripts can be reviewed by supervisors
scripts are often shared with colleagues
![Page 26: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/26.jpg)
FieldTrip private functions(low-level)
FieldTrip private functions(low-level)
FieldTrip main functions
end-user perspective
FieldTrip toolbox structure - at a glance
![Page 27: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/27.jpg)
FieldTrip toolbox structure - a closer look
fileiofileio forwinvforwinv preprocpreproc privateprivate
FieldTrip main functions
end-user perspective
publicpublic
multivar.multivar.distrib.
comput.distrib.
comput.
![Page 28: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/28.jpg)
FieldTrip toolbox structure - a closer look
fileiofileio forwinvforwinv preprocpreproc privateprivate
end-user perspective
preprocessingpreprocessing
dipolefittingdipolefitting
freqanalysisfreqanalysis sourcestatisticssourcestatistics
……
read_data(…)read_data(…) compute_leadfield(…)compute_leadfield(…)bandpassfilter(…)bandpassfilter(…)
distrib.comput.distrib.
comput.
publicpublic
multivar.multivar.
![Page 29: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/29.jpg)
FieldTrip toolbox structure - a closer look
fileiofileio forwinvforwinv preprocpreproc privateprivate
FieldTrip main functions
end-user perspective
publicpublic
multivar.multivar.distrib.
comput.distrib.
comput.
![Page 30: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/30.jpg)
FieldTrip toolbox - code reused in SPM8
fieldtripfieldtripfileiofileio forwinvforwinv
privateprivate
main functions publicpublicSPM8 main functions
with graphical user interface
SPM8 end-user perspective
preprocpreprocdistrib.
comput.distrib.
comput.
![Page 31: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/31.jpg)
Why use FieldTrip?
contains many algorithms
demonstrated to be an effective tool for analyzing electrophysiological data
active user community
new methods contributed by others
collaboration with other packages
expertise from developers made accessible
expertise from other users made available
![Page 32: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/32.jpg)
Network identification in non-invasive measurements
ROIPower MEG-coherenceCM-coherence
![Page 33: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/33.jpg)
Network identification
all voxel combinations
![Page 34: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/34.jpg)
Network identification
Who is hot....? ...and who is not?
![Page 35: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/35.jpg)
Power
FWHM
Non-homogeneous maps
![Page 36: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/36.jpg)
Simulations
• 2 dipoles in 2 conditions– correlated dipoles
– uncorrelated dipoles
• Reconstruct all-to-all bivariate correlation map with beamformers
• Non-homogeneous smoothing
• 6 dimensional gaussian kernel depending on FWHM– little smoothing for high activations
– more smoothing for low activations
• Many dipole pairs at various SNR etc.
![Page 37: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/37.jpg)
Results: general effects
![Page 38: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/38.jpg)
Results: hit rate
unsmoothed
smoothed
![Page 39: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/39.jpg)
Results: false positives
![Page 40: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/40.jpg)
Summary
• Identification of functionally connected nodes in a neural network based on non-invasive measurements
• Spurious connections / low sensitivity
• Non-homogeneous smoothing improves sensitivity
• …on simulated data
![Page 41: FieldTrip, a tool for GUI-less exploration of brain dynamics](https://reader036.fdocuments.us/reader036/viewer/2022062323/568159e3550346895dc72ce5/html5/thumbnails/41.jpg)
Do you want to give it a try yourself?
http://fieldtrip.fcdonders.nl/
Acknowledgements:
Monkey stuff-Conrado Bosman-Andre Bastos-Robert Oostenveld-Pascal Fries
Non-homogeneous smoothing-Joachim Gross