Skip to content

Commit

Permalink
only some formatting following fieldtrip#814
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoostenveld authored and schoffelen committed Nov 26, 2024
1 parent f8fcd1d commit 0276bb5
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 77 deletions.
135 changes: 65 additions & 70 deletions workshop/cuttingeegx.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ tags: [cuttingeegx]

# CuttingEEG X workshop at the Donders

CuttingEEG is turning 10 years old! This milestone calls for a special edition, looking back at the EEG and MEG fields of the past 10 years and looking ahead at the next 10 years and beyond!

Alongside the [CuttingEEG X](https://cuttingeegx.org) conference we will be organizing some local workshops in the morning.
CuttingEEG is turning 10 years old! This milestone calls for a special edition, looking back at the EEG and MEG fields of the past 10 years and looking ahead at the next 10 years and beyond! Alongside the [CuttingEEG X](https://cuttingeegx.org) conference we are organizing a number of local workshops that will take place in the morning. This specific page describes the content and practicalities for the FieldTrip OPM workshop, but there is also the MNE-Python workshop (presented by Britta Westner and Tilman Stephani) and the Git/GitHub workshop (presented by Julia Chauvet, Jan-Mathijs and Robert).

- Who: Konstantinos Tsilimparis, Robert Oostenveld, Jan-Mathijs Schoffelen
- When: 31 October 2024
- Where: Nijmegen
- See <https://cuttingeegx.org/registration/#Nijmegen> for more details
- See <https://cuttingeegx.org/registration/#Nijmegen> for the timetable and more details

## The tutorial

We will run a tutorial on [preprocessing and coregistration of SQUID-based and OPM-based data](/workshop/cuttingeegx/squids_vs_opms). We will explore the differences in data analysis between the two MEG systems.
We will run a tutorial on [preprocessing and coregistration of SQUID-based and OPM-based data](/workshop/cuttingeegx/squids_vs_opms). We will explore the differences in data analysis between the two MEG systems.

## Getting started with the hands-on session

Expand All @@ -28,13 +26,11 @@ If you don't have a eduroam account through your institution, it is possible to

### MATLAB

For the hands-on sessions we assume that you have a computer with a relatively recent version of MATLAB installed (preferably < 5 years old, >= 2019a/b).
For the hands-on sessions we assume that you have a computer with a relatively recent version of MATLAB installed (preferably < 5 years old, so >= 2019a/b).

### FieldTrip

To get the most recent copy of FieldTrip, you can follow this [link](https://github.com/fieldtrip/fieldtrip/releases/tag/20240916), download the zip-file, and unzip it at a convenient location on your laptop's hard drive.

Alternatively, you could do the following in the MATLAB command window (less work and faster downloading):
To get the most recent copy of FieldTrip, you can follow this [link](https://github.com/fieldtrip/fieldtrip/releases/tag/20240916), download the zip-file, and unzip it at a convenient location on your laptop's hard drive. Alternatively, you can do the following in the MATLAB command window (less work and more robust):

```
% create a folder that will contain the code and the data, and change directory
Expand All @@ -46,38 +42,39 @@ url_fieldtrip = 'https://github.com/fieldtrip/fieldtrip/archive/refs/tags/202409
unzip(url_fieldtrip);
```

Upon completion of this step, the folder structure should look something like this:
Upon completion of this step, the folder structure should look something like this:

```bash
cuttingeegx/
|-- fieldtrip-20240916
|-- bin
|-- compat
|-- connectivity
|-- contrib
|-- external
|-- fileio
|-- forward
|-- inverse
|-- plotting
|-- preproc
|-- private
|-- qsub
|-- realtime
|-- specest
|-- src
|-- statfun
|-- template
|-- test
|-- trialfun
|-- utilities
└── fieldtrip-20240916
├── bin
├── compat
├── connectivity
├── contrib
├── external
├── fileio
├── forward
├── inverse
├── plotting
├── preproc
├── private
├── qsub
├── realtime
├── specest
├── src
├── statfun
├── template
├── test
├── trialfun
└── utilities
```

{% include markup/red %}
Downloading and unzipping can take up to ~10 minutes, so please download and unzip FieldTrip prior to the workshop.
{% include markup/end %}

{% include markup/red %}
If you have downloaded and unzipped by hand, it could be that there's an 'extra folder layer' in your directory structure. We recommend that you remove this extra layer, i.e. move all content one level up.
If you have downloaded and unzipped by hand on a Windows computer, it could be that there's an 'extra folder layer' in your directory structure and that it appears as `fieldtrip-20240916/fieldtrip-20240916`. We recommend that you remove this extra layer, i.e., move all content one level up.
{% include markup/end %}

### Test your installation in advance
Expand All @@ -86,12 +83,12 @@ To have a smooth experience - and to avoid having to spend precious debugging ti

## The data used in this tutorial

Next, we proceed with downloading the relevant data. The data that are used in the hands-on sessions are stored on the FieldTrip [download-server](https://download.fieldtriptoolbox.org/workshop/cuttingeegx). The data are approximately 1.3 Gb. You can either ‘click around’ using web browsers and/or explorer windows to grab the data that are needed, or instead (less work) execute the MATLAB code below.
Next, we proceed with downloading the relevant data from the FieldTrip [download server](https://download.fieldtriptoolbox.org/workshop/cuttingeegx). The data are approximately 1.3 Gb. You can either ‘click around’ using your web browser and/or windows explorer to grab the data that are needed, or instead (less work and more robust) execute the MATLAB code below.

Please ensure that your present working directory is the ``'cuttingeegx'``, which you created in the previous step. Open a new .m file in the editor, copy the following code and run the whole script (Note: To properly run the function ``'recursive_download'``, do not use the command line window and do not run the code line-by-line):
Please do ensure that your present working directory is the `cuttingeegx` which you created in the previous step. Open a new m-file in the MATLAB editor, copy-and-paste the following code and run the whole script. Note: to properly run the function `recursive_download`, do not paste this code into the command line window and do not run the code line-by-line:

```
% create a folder (within cuttingeegx) that will contain the data
% Create a folder (within cuttingeegx) to contain the data
mkdir('data');
cd('data');
Expand Down Expand Up @@ -164,51 +161,49 @@ function recursive_download(webLocation, localFolder)
end
```

At this stage, you ideally have a directory structure that looks like the following one:
At this stage, you should have a directory structure like this:

```bash
cuttingeegx/
|-- data
|-- sub-001
|-- anat
|-- meg
|-- opm
|-- squid
|-- fieldtrip-20240916
|-- bin
|-- compat
|-- connectivity
|-- contrib
|-- external
|-- fileio
|-- forward
|-- inverse
|-- plotting
|-- preproc
|-- private
|-- qsub
|-- realtime
|-- specest
|-- src
|-- statfun
|-- template
|-- test
|-- trialfun
|-- utilities
cuttingeegx/data/
└── sub-01
│ ├── anat
│ └── meg
│ ├── opm
│ └── squid
└── fieldtrip-20240916
├── bin
├── compat
├── connectivity
├── contrib
├── external
├── fileio
├── forward
├── inverse
├── plotting
├── preproc
├── private
├── qsub
├── realtime
├── specest
├── src
├── statfun
├── template
├── test
├── trialfun
└── utilities
```


Whenever starting a fresh MATLAB session, to configure the right FieldTrip paths, execute the following:
Whenever starting a fresh MATLAB session, to configure the right FieldTrip paths, execute the following:

```
% change into the 'cuttingeegx' folder and then do the following
restoredefaultpath
addpath('fieldtrip-20240916');
addpath(genpath('data'));
ft_defaults;
addpath('fieldtrip-20240916')
addpath(genpath('data'))
ft_defaults
```

`ft_defaults` command ensures that all of FieldTrip's required subdirectories are added to the path.
The `restoredefaultpath` command sets the path to the MATLAB default, clearing any custom toolboxes that you may have but that we don't need today. The `ft_defaults` command ensures that all of FieldTrip's required subdirectories are added to the path.

{% include markup/red %}
Furthermore, please do NOT add FieldTrip with all subdirectories, subdirectories will be added automatically when needed, and only when needed (see this [FAQ](/faq/installation)).
Expand Down
14 changes: 7 additions & 7 deletions workshop/cuttingeegx/test_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Prior to the hands-on sessions, you need to check the functionality of the compu
[ftver, ftpath] = ft_version;
fprintf('FieldTrip path is at: %s\n', ftpath);
fprintf('FieldTrip version is: %s\n', ftver);
fprintf('ttest is: %s\n', which('ttest'))
fprintf('imdilate is: %s\n', which('imdilate'));
fprintf('dpss is: %s\n', which('dpss'));
fprintf('fminunc is: %s\n', which('fminunc'));
fprintf('ft_read_data is: %s\n', which('ft_read_data'));
fprintf('runica is: %s\n', which('runica')); % don't worry if this path is not be found yet
fprintf('spm is: %s\n', which('spm')); % don't worry if this path is not be found yet
fprintf('ttest is: %s\n', which('ttest'))
fprintf('imdilate is: %s\n', which('imdilate'));
fprintf('dpss is: %s\n', which('dpss'));
fprintf('fminunc is: %s\n', which('fminunc'));
fprintf('ft_read_data is: %s\n', which('ft_read_data'));
fprintf('runica is: %s\n', which('runica')); % don't worry if this path is not be found yet
fprintf('spm is: %s\n', which('spm')); % don't worry if this path is not be found yet
fprintf('################################################################\n');

cd .. % go back to the 'cuttingeegx' directory

0 comments on commit 0276bb5

Please sign in to comment.