Skip to content

Commit f8ae9ef

Browse files
committed
update to eyetracking filenaming
1 parent ecc6d7d commit f8ae9ef

File tree

5 files changed

+70
-31
lines changed

5 files changed

+70
-31
lines changed

.travis.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
# Travis CI (https://travis-ci.org/)
2+
# This will only work on your repo if you have an account on travis and you
3+
# have set it up to run continuous integration on this this repo
4+
5+
# Linux distribution (bionic beaver)
6+
dist: bionic
7+
8+
# Language and version
9+
language: python
10+
python:
11+
- "3.6" # current default Python on Travis CI
212

3-
language: c
4-
dist: bionic # based on bionic beaver ubuntu distribution
513
cache:
614
apt: true # only works with Pro version
715

816
env:
9-
global: # define environment variables for bash
17+
global: # Define environment variables for bash
1018
- OCTFLAGS="--no-gui --no-window-system --silent"
1119

1220
before_install:
1321
- travis_retry sudo apt-get -y -qq update
14-
# install octave
22+
# Install octave
1523
- travis_retry sudo apt-get -y install octave
1624
- travis_retry sudo apt-get -y install liboctave-dev
17-
# install javascript
25+
# Install javascript node and node package manager necessary to run the validator
1826
- travis_retry sudo apt-get -y install nodejs
1927
- travis_retry sudo apt-get -y install npm
20-
# install miss_hit linter
21-
- cd .. && git clone https://github.com/florianschanda/miss_hit.git && export PATH=$PATH:`pwd`/miss_hit && cd CPP_BIDS
22-
28+
# Install BIDS-Validator
29+
- sudo npm install -g bids-validator
30+
# Install miss_hit linter
31+
- pip3 install miss_hit
2332

2433
install:
2534
# make octave file the JSONio submodule
2635
- cd lib/JSONio; mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS; cd ../..
2736
- octave $OCTFLAGS --eval "addpath (pwd); savepath ();"
28-
# Install BIDS-Validator
29-
- sudo npm install -g bids-validator
3037

3138
before_script:
3239
# Add to src functions to path
@@ -36,11 +43,9 @@ before_script:
3643

3744
jobs:
3845
include:
39-
- stage: "BIDS validator"
40-
name: "Create and check dataset"
46+
- name: "BIDS validator: create and check dataset"
4147
script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/rawdata/ --ignoreNiftiHeaders
42-
- stage: "Linter"
43-
name: "miss_hit"
44-
script: cd .. && mh_style `pwd`
45-
46-
48+
- name: "miss_hit: checking code quality"
49+
script: mh_metric . --ci
50+
- name: "miss_hit: checking code style"
51+
script: mh_style .

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ Feel free to open issues to report a bug and ask for improvements.
7676

7777
Here are the naming templates used.
7878

79+
- Behavior
80+
81+
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.tsv`
82+
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_events.json`
83+
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_beh.tsv`
84+
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_run-<index>]_beh.json`
85+
7986
- BOLD
8087

8188
`sub-<label>[_ses-<label>]_task-<label>[_acq-<label>][_ce-<label>][_dir-<label>][_rec-<label>][_run-<index>][_echo-<index>]_<contrast_label>.nii[.gz]`
@@ -87,15 +94,43 @@ Here are the naming templates used.
8794
- EEG
8895

8996
`sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_eeg.<manufacturer_specific_extension>`
97+
`sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_eeg.json`
98+
99+
<!-- European data format (Each recording consisting of a .edf file)
100+
101+
BrainVision Core Data Format (Each recording consisting of a .vhdr, .vmrk, .eeg file triplet)
102+
103+
The format used by the MATLAB toolbox EEGLAB (Each recording consisting of a .set file with an optional .fdt file)
104+
105+
Biosemi data format (Each recording consisting of a .bdf file) -->
106+
107+
108+
EEGReference REQUIRED. General description of the reference scheme used and (when applicable) of location of the reference electrode in the raw recordings (e.g., "left mastoid", "Cz", "CMS"). If different channels have a different reference, this field should have a general description and the channel specific reference should be defined in the _channels.tsv file.
109+
SamplingFrequency REQUIRED. Sampling frequency (in Hz) of all the data in the recording, regardless of their type (e.g., 2400).
110+
PowerLineFrequency REQUIRED. Frequency (in Hz) of the power grid at the geographical location of the EEG instrument (i.e., 50 or 60).
111+
SoftwareFilters REQUIRED. A JSON object of temporal software filters applied, or "n/a" if the data is not available. Each key:value pair in the JSON object is a name of the filter and an object in which its parameters are defined as key:value pairs. E.g., {"Anti-aliasing filter": {"half-amplitude cutoff (Hz)": 500, "Roll-off": "6dB/Octave"}}.
112+
113+
90114

91115
- MEG
92116

93117
???
94118

95119
- Eyetracker
96120

121+
current format
122+
`<matches>_recording-eyetracking_physio.tsv.gz`
123+
124+
future BEP format in a dedicated eyetracker folder
97125
`sub-<participant_label>[_ses-<label>][_acq-<label>]_task-<task_label>_eyetrack.<manufacturer_specific_extension>`
98126

127+
- Stim and physio
128+
129+
`<matches>[_recording-<label>]_physio.tsv.gz`
130+
`<matches>[_recording-<label>]_physio.json`
131+
`<matches>[_recording-<label>]_stim.tsv.gz`
132+
`<matches>[_recording-<label>]_stim.json`
133+
99134
### 3.3. <a name='Contributors'></a>Contributors ✨
100135

101136
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

miss_hit.cfg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html)
12
line_length: 100
23
regex_function_name: "[a-z]+(([A-Z]){1}[A-Za-z]+)*"
34
suppress_rule: "copyright_notice"
4-
exclude_dir: "lib"
5+
exclude_dir: "lib"
6+
7+
# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)
8+
metric "cnest": limit 4
9+
metric "file_length": limit 500
10+
metric "cyc": limit 15
11+
metric "parameters": limit 6

src/createFilename.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@
9090
[~, ~, ~] = mkdir(cfg.dir.output);
9191
[~, ~, ~] = mkdir(cfg.dir.outputSubject);
9292
[~, ~, ~] = mkdir(fullfile(cfg.dir.outputSubject, modality));
93-
94-
if cfg.eyeTracker.do
95-
[~, ~, ~] = mkdir(fullfile(cfg.dir.outputSubject, 'eyetracker'));
96-
end
97-
93+
9894
end
9995

10096
function cfg = setSuffixes(cfg)
@@ -190,7 +186,7 @@
190186
if cfg.eyeTracker.do
191187
cfg.fileName.eyetracker = ...
192188
[fileNameBase, acqSuffix, ...
193-
runSuffix, '_eyetrack_date-' thisDate '.edf'];
189+
runSuffix, '_recording-eyetracking_physio_date-' thisDate '.edf'];
194190
end
195191

196192
end

tests/test_createFilename.m

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ function test_createFilenameBasic()
2323
%% data to test against
2424
behDir = fullfile(outputDir, 'source', 'sub-001', 'ses-001', 'beh');
2525

26-
eyetrackerDir = fullfile(outputDir, 'source', 'sub-001', 'ses-001', 'eyetracker');
27-
2826
eventFilename = ['sub-001_ses-001_task-testTask_run-001_events_date-'...
2927
cfg.fileName.date '.tsv'];
3028

@@ -36,9 +34,6 @@ function test_createFilenameBasic()
3634
% make sure the beh dir is created
3735
assertTrue(exist(behDir, 'dir') == 7);
3836

39-
% make sure the eyetracker dir is not created
40-
assertTrue(exist(eyetrackerDir, 'dir') == 0);
41-
4237
% make sure the events filename is created
4338
assertEqual(cfg.fileName.events, eventFilename);
4439

@@ -70,14 +65,15 @@ function test_createFilenameMriEyetracker()
7065

7166
funcDir = fullfile(outputDir, 'source', 'sub-ctrl002', 'ses-002', 'func');
7267

73-
eyetrackerDir = fullfile(outputDir, 'source', 'sub-ctrl002', 'ses-002', 'eyetracker');
68+
eyetrackerDir = fullfile(outputDir, 'source', 'sub-ctrl002', 'ses-002', 'func');
7469

7570
baseFilename = 'sub-ctrl002_ses-002_task-testTask';
7671

7772
eventFilename = ['sub-ctrl002_ses-002_task-testTask_run-002_events_date-' ...
7873
cfg.fileName.date '.tsv'];
7974

80-
eyetrackerFilename = ['sub-ctrl002_ses-002_task-testTask_run-002_eyetrack_date-' ...
75+
eyetrackerFilename = [...
76+
'sub-ctrl002_ses-002_task-testTask_run-002_recording-eyetracking_physio_date-' ...
8177
cfg.fileName.date '.edf'];
8278

8379
%% tests

0 commit comments

Comments
 (0)