You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workshop/cuttingeegx.md
+202-2Lines changed: 202 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,207 @@ CuttingEEG is turning 10 years old! This milestone calls for a special edition,
9
9
10
10
Alongside the [CuttingEEG X](https://cuttingeegx.org) conference we will be organizing some local workshops in the morning.
11
11
12
-
- Who: Julia Chauvet, Konstantinos Tsilimparis, Britta Westner, Tilman Stephani, Robert Oostenveld
13
-
- When: 30 to 31 October 2024
12
+
- Who: Konstantinos Tsilimparis, Robert Oostenveld. Jan-Mathijs Schoffelen
13
+
- When: 31 October 2024
14
14
- Where: Nijmegen
15
15
- See <https://cuttingeegx.org/registration/#Nijmegen> for more details
16
+
17
+
## The tutorial
18
+
19
+
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.
20
+
21
+
## Getting started with the hands-on session
22
+
23
+
In this workshop you will work on your own laptop computer. It will be an in-person event with no possibilities for hybrid or online attendance.
24
+
25
+
### Wifi access
26
+
27
+
If you don't have a eduroam account through your institution, it is possible to get a visitor access. Please let us know if you need a visitor access at the day of the workshop.
28
+
29
+
### MATLAB
30
+
31
+
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).
32
+
33
+
### FieldTrip
34
+
35
+
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.
36
+
37
+
Alternatively, you could do the following in the MATLAB command window (less work and faster downloading):
38
+
39
+
```
40
+
% create a folder that will contain the code and the data, and change directory
41
+
mkdir('cuttingeegx');
42
+
cd('cuttingeegx');
43
+
44
+
% download and unzip fieldtrip into the newly created folder
Upon completion of this step, the folder structure should look something like this:
50
+
51
+
```bash
52
+
cuttingeegx/
53
+
|-- fieldtrip-20240916
54
+
|-- bin
55
+
|-- compat
56
+
|-- connectivity
57
+
|-- contrib
58
+
|-- external
59
+
|-- fileio
60
+
|-- forward
61
+
|-- inverse
62
+
|-- plotting
63
+
|-- preproc
64
+
|-- private
65
+
|-- qsub
66
+
|-- realtime
67
+
|-- specest
68
+
|-- src
69
+
|-- statfun
70
+
|-- template
71
+
|-- test
72
+
|-- trialfun
73
+
|-- utilities
74
+
```
75
+
{% include markup/red %}
76
+
Downloading and unzipping can take up to ~10 minutes, so please download and unzip FieldTrip prior to the workshop.
77
+
{% include markup/end %}
78
+
79
+
{% include markup/red %}
80
+
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.
81
+
{% include markup/end %}
82
+
83
+
### Test your installation in advance
84
+
85
+
To have a smooth experience - and to avoid having to spend precious debugging time during the hands-on sessions - we recommend that you [test your MATLAB and FieldTrip installation in advance](/workshop/cuttingeegx/test_installation).
86
+
87
+
## The data used in this tutorial
88
+
89
+
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). You can either ‘click around’ using web browsers and/or explorer windows to grab the data that are needed, or instead (less work, at least if it works) execute the MATLAB code below.
90
+
91
+
Please ensure that your present working directory is the ``'cuttingeegx'`` folder, which you created in the previous step. Open a new .m file in the text editor and run the following (Note: do not use the command line window):
92
+
93
+
```
94
+
% create a folder (within cuttingeegx) that will contain the data
function recursive_download(webLocation, localFolder)
104
+
105
+
% RECURSIVE_DOWNLOAD downloads a complete directory from a RESTful web service
106
+
%
107
+
% Use as
108
+
% recursive_download(webLocation, localFolder)
109
+
%
110
+
% See also WEBREAD, WEBSAVE, UNTAR, UNZIP, GUNZIP
111
+
112
+
% Copyright (C) 2023, Konstantinos Tsilimparis
113
+
%
114
+
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
115
+
% for the documentation and details.
116
+
%
117
+
% FieldTrip is free software: you can redistribute it and/or modify
118
+
% it under the terms of the GNU General Public License as published by
119
+
% the Free Software Foundation, either version 3 of the License, or
120
+
% (at your option) any later version.
121
+
%
122
+
% FieldTrip is distributed in the hope that it will be useful,
123
+
% but WITHOUT ANY WARRANTY; without even the implied warranty of
124
+
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125
+
% GNU General Public License for more details.
126
+
%
127
+
% You should have received a copy of the GNU General Public License
128
+
% along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
129
+
%
130
+
% $Id$
131
+
132
+
% Read the HTML content of the URL
133
+
htmlContent = webread(webLocation);
134
+
pattern = '<a href="([^"]+)">';
135
+
matches = regexp(htmlContent, pattern, 'tokens');
136
+
137
+
% Iterate over the matches
138
+
for i = 2:numel(matches) % Ignore i=1, which is the parent directory link: '../'
139
+
item = matches{i}{1};
140
+
141
+
if endsWith(item, '/') % It is a folder
142
+
% Create the necessary directories if they do not exist
143
+
subfolder = fullfile(localFolder, item);
144
+
if ~isfolder(subfolder)
145
+
mkdir(subfolder);
146
+
end
147
+
148
+
% Recursively download the subfolder
149
+
subWebLocation = strcat(webLocation, '/', item);
150
+
recursive_download(subWebLocation, subfolder);
151
+
152
+
else % It is a file
153
+
% Create the necessary directories if they do not exist
154
+
if ~isfolder(localFolder)
155
+
mkdir(localFolder);
156
+
end
157
+
158
+
% Download the file
159
+
fileUrl = strcat(webLocation, '/', item);
160
+
localFilePath = fullfile(localFolder, item);
161
+
websave(localFilePath, fileUrl);
162
+
end
163
+
end
164
+
end
165
+
```
166
+
167
+
At this stage, you ideally have a directory structure that looks like the following one:
168
+
169
+
```bash
170
+
cuttingeegx/
171
+
|-- data
172
+
|-- sub-001
173
+
|-- anat
174
+
|-- meg
175
+
|-- opm
176
+
|-- squid
177
+
|-- fieldtrip-20240916
178
+
|-- bin
179
+
|-- compat
180
+
|-- connectivity
181
+
|-- contrib
182
+
|-- external
183
+
|-- fileio
184
+
|-- forward
185
+
|-- inverse
186
+
|-- plotting
187
+
|-- preproc
188
+
|-- private
189
+
|-- qsub
190
+
|-- realtime
191
+
|-- specest
192
+
|-- src
193
+
|-- statfun
194
+
|-- template
195
+
|-- test
196
+
|-- trialfun
197
+
|-- utilities
198
+
```
199
+
200
+
201
+
Whenever starting a fresh MATLAB session, to configure the right FieldTrip paths, execute the following:
202
+
203
+
```
204
+
% change into the 'cuttingeegx' folder and then do the following
205
+
restoredefaultpath
206
+
addpath('fieldtrip-20240916');
207
+
addpath(genpath('data'));
208
+
ft_defaults;
209
+
```
210
+
211
+
`ft_defaults` command ensures that all of FieldTrip's required subdirectories are added to the path.
212
+
213
+
{% include markup/red %}
214
+
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)).
0 commit comments