Welcome to the FieldTrip website

FieldTrip is the MATLAB software toolbox for MEG, EEG, iEEG and NIRS analysis. It offers preprocessing and advanced analysis methods, such as time-frequency analysis, source reconstruction using dipoles, distributed sources and beamformers and non-parametric statistical testing. It supports the data formats of all major MEG systems and of the most popular EEG, iEEG and NIRS systems. New data formats can be added easily. FieldTrip contains high-level functions that you can use to construct your own analysis protocols as a MATLAB script.

The FieldTrip software is released free of charge as open source software under the GNU general public license.

Please cite the FieldTrip reference paper when you have used FieldTrip in your study.

Robert Oostenveld, Pascal Fries, Eric Maris, and Jan-Mathijs Schoffelen. FieldTrip: Open Source Software for Advanced Analysis of MEG, EEG, and Invasive Electrophysiological Data. Computational Intelligence and Neuroscience, vol. 2011, Article ID 156869, 9 pages, 2011. doi:10.1155/2011/156869.

To get started with FieldTrip, continue reading the getting started documentation.

News and announcements

01 July, 2020

In FieldTrip release 20200701 the low-level functions in fieldtrip/inverse have been renamed to ft_inverse_xxx and their input and output arguments have been cleaned up. This addresses a long-standing plan for improving the inverse modeling API. Except for the renaming of the low-level functions (which you won’t notice if you call them through the high-level ft_sourceanalysis and ft_dipolefitting) there are no functional changes.

24 June, 2020

We are sorry to report that with merging the recent pull request #1377 about a month ago, we introduced a bug in the FieldTrip release that might have affected your computations.

Specifically, the handling of the defaults for cfg.reducerank and the cfg.backproject changed a bit, which had an unforeseen sideeffect in ft_prepare_leadfield, if (and only if) you used this function for the computation of MEG-based leadfields, using the singleshell method. Specifically, ft_prepare_leadfield would by default compute MEG singleshell leadfields with reducerank=2 (this is how it always has been), but it would wrongly backproject (i.e. the intended projection of the rank-reduced 2-column leadfield back into 3D space with a column for the x, y, and z dipole moment in Cartesian space) the rank-reduced leadfield. Rather, ft_prepare_leadfield would on line 292 discard the last column. The error was due to MATLAB interpreting if [] as false, causing on line 295 only the first two columns to be copied to the output. Consequently, the leadfield for the z-direction was discarded.

Are you affected? If you used the master branch from GitHub (which is the development version), or a release version between 20200529 and 20200607, and if you have used ft_prepare_leadfield for MEG with singleshell models, then you are likely affected. You can check yourself: your precomputed leadfields should have three columns; if they only have two columns and you did not explicityly specify reducerank and backproject in your configuration, your leadfields are wrong. Other models than MEG singleshell are not affected.

To resolve the problem, please update to the latest 20200623 release version from the FTP server or from the GitHub release page and recompute your leadfields, source estimates, etcetera.

11 June, 2020

Robert and Jan-Mathijs have made an improvement to how color schemes can be specified. In functions supporting cfg.colormap, you can now also specify a subset of the color schemes that are in matplotlib, as well as the brewermap color schemes (e.g. ‘RdBu’). See ft_colormap for more information.

In this movie you can see Robert and Jan-Mathijs working on this. And finally, as a bonus, we have added an ‘ftcolors’ colormap, which will give your artwork this extra FieldTrippy feel. Happy plotting!

28 May, 2020

We have changed the links to the reference documentation (i.e. the help that is at the start of each FieldTrip function) here on the website such that they now point to the code on GitHub, rather than to a Markdown copy of the fucntion help on the website. This makes it possible to scroll down past the help, and to look at the code and the details of the implementation. Also, it makes it easier for you to contribute your suggestions to the help or to the code itself: You can simply click on the “pencil” symbol in the upper right corner.

If you want to know more about contributing, please see here. We also have a detailed git and GitHub tutorial that explains it in much more detail.

07 May, 2020

During the recent toolkit, which took place online, the participants worked on their own computers, causing a larger than usual variability on MATLAB versions and Operating Systems. One issue we encountered was a compatibility problem with SPM-related mex-files. Specfically, when using the default version, which up until now has been spm8, certain functions did not work. We are typically reluctant to change default behavior of functions, but now we decided to upgrade the default SPM version to spm12, for a more stable user experience overall. We expect this change to be inconsequential for most of you, but would like to note that, when needed, you can always go back to using spm8, by specifying cfg.spmversion=’spm8’, wherever appropriate. Note that cfg.spmversion is only a supported option for the high-level fieldtrip functions.

29 April, 2020

Last week we hosted the MEG/EEG toolkit course online. Due to the COVID-19 pandemic we had to transform it in an online format in which almost everyone (participants and tutors) were attending from home. The format consisted of lectures, extended Q&A sessions, and hands-on sessions where participants worked on tutorials on their own computer. Besides doing it online, this posed additional challenges, with kids at home requiring attention, with time-zone differences, and with some participants now also having clinical duties. This required a lot of creativity of everyone involved, resulting in interesting opportunities. In short: it was a great success, with very good interaction between the about 35 participants and the tutors.

We have documented the work that went into the preparations, the instruction “manual” that we wrote for the participants and tutors, and also some of the lessons we learned along the way. Furthermore, where possible we recorded the online Zoom lectures and Q&A sessions, allowing others to learn from them as well. Please see the 2020 toolkit page for all details.

21 April, 2020

We kicked off the online MEG/EEG toolkit yesterday, and today it was again in full swing! After this week we will post the material online on the 2020 toolkit page, including details on how we organized the online lectures, interactive sessions and hands-on practical exercises with the tutors being virtually available to help the participants.

See below a “group photo”. Actually it is only part of the group; we have about 35 online participants, but Zoom is limited and only shows 25 on a single screen.

9 April, 2020

Although we cannot host the M/EEG toolkit in Nijmegen itself, we are happy that it will nevertheless go on. We will host it online, and have created a suitable program for the ~40 selected participants with lectures, online hands-on sessions and a lot of interaction. Getting to know each other, active participation and interacting remains as important online as it would be in normal years. If you want, have a look at the 2020 toolkit page where the program details will be posted afterwards, and at the list of lecturers and tutors that are enthusiastic about trying out this new format!

16 March, 2020

Dear friends and colleagues, on behalf of the FieldTrip team we would like to say bon courage to all of you. Right now most of public life has ground to a halt in the Netherlands, like in many other countries. We will be working from home in the coming period but will try to stay operational as much as possible. Among others, we are looking into options to host the upcoming M/EEG toolkit online. Keep your head cool, and take care of yourself and each other. Jan-Mathijs and Robert

05 February, 2020

We have added a new tutorial on computing and reporting effect sizes using FieldTrip, also following cluster-based permutations tests. This is an additional step forward in our commitment to open, transparent and reproducible science.

20 January, 2020

From 20-24 April 2020 we will again host the “Advanced MEG/EEG toolkit” at the Donders Institute in Nijmegen. See here for more details and a link to the registration form.

Recent improvements to the code

All changes to the code can be tracked on Twitter and GitHub.