quick intro to fieldtrip intro to fieldtrip.pdffieldtrip data structures (example) data = hdr: [1x1...

11
Quick intro to FieldTrip Get started in 5 minutes

Upload: others

Post on 22-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

Quick intro to FieldTrip

Get started in 5 minutes

Page 2: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis
Page 3: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

What is FieldTrip?

An open-source MATLAB toolbox for processing and analysing electrophysiological data

Data-processing

Analysis of evoked and induced responses

Source analysis

Connectivity

Group analysis

Statistics

Page 4: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

Set up FieldTrip

Download FieldTrip:

http://www.fieldtriptoolbox.org/download

• Sign up

• Find current date

• Download

• Put in easy to access folder (e.g. /home/ or C:/)

GitHub:

http://github.com/fieldtrip/fieldtrip

Page 5: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

Set up FieldTrip

In Matlab terminal:> addpath ‘~/mypath/fieldtrip’

> ft_defaults

> cd ‘/my_working_directory’

NB: If you have SPM as a default path, remove before setting up FieldTrip.

> restoredefaultpath

Page 6: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

FieldTrip functions

data_out = ft_functionname(cfg)

data_out = ft_functionname(cfg, data_in)

”cfg” is configuration structurecfg.key1 = value1

cfg.key2 = value2

...etc.

Tip: Start each new cfg by clearing previouscfg = []; %Reset cfg

Page 7: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

Need more help?

Get documentation for functions for help, cfg options, etc, use the help function in MATLAB:> help ft_functionname

Online tutorial, examples and documentation:http://www.fieldtriptoolbox.org/

Page 8: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

FieldTrip data structures (example)

data =

hdr: [1x1 struct] Header infolabel: {306x1 cell} Channel namestime: {1x600 cell} Time axis for each trialtrial: {1x600 cell} Trial data [channels x timepoints]fsample: 200 Sampling frequency (Hz)sampleinfo: [600x2 double] [Start end] of each trial in raw datatrialinfo: [600x3 double] Trial bookkeepinggrad: [1x1 struct] Gradiometer positions, etcelec: [1x1 struct] Electrode positions, etccfg: [1x1 struct] Previous configuration (for bookkeeping)

Page 9: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

What is in the data structures?

> cfg = [];

> cfg.layout = 'neuromag306mag.lay‘;

> ft_multiplotER(cfg, timelockeds{:});

Page 10: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

Summary

data_out = ft_functionname(cfg, data_in)

help ft_functionname

Write variable name in terminal to see what it contain

Page 11: Quick intro to FieldTrip intro to FieldTrip.pdfFieldTrip data structures (example) data = hdr: [1x1 struct] Header info label: {306x1 cell} Channel names time: {1x600 cell} Time axis

megnord.org/2018/workshops.html