Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regexps for space entity: EEG and iEEG #1190

Merged
merged 9 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
name: Eslint
command: yarn lint
- run:
name: Test Data
name: Get bids-examples data
command: git submodule update --init
- run:
name: Jest tests
Expand All @@ -52,7 +52,9 @@ jobs:
command: yarn codecov
- run:
name: Smoke tests
command: bids-validator/bin/bids-validator bids-validator/tests/data/valid_headers/ --ignoreNiftiHeaders && bids-validator/bin/bids-validator bids-validator/tests/data/valid_headers/ --ignoreNiftiHeaders --json
command: |
bids-validator/bin/bids-validator bids-validator/tests/data/valid_headers/ --ignoreNiftiHeaders
bids-validator/bin/bids-validator bids-validator/tests/data/valid_headers/ --ignoreNiftiHeaders --json
test_docker:
machine:
# Ubuntu 16.04, docker 18.09.3, docker-compose 1.23.1
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/test-bids-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: test-bids-examples

on:
push:
branches: ['**']
pull_request:
branches: ['**']

jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
bids-validator-branch: [master]
bids-examples-branch: [bep001_qmri]

runs-on: ${{ matrix.platform }}

env:
TZ: Europe/Berlin
FORCE_COLOR: 1

steps:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12

- name: Install bids-validator
run: |
git clone --depth 1 https://github.com/bids-standard/bids-validator -b ${{ matrix.bids-validator-branch }}
npm install -g bids-validator/bids-validator

- name: Get bids-examples data
run: |
git clone --depth 1 https://github.com/bids-standard/bids-examples -b ${{ matrix.bids-examples-branch }}

- name: Display versions and environment information
run: |
echo $TZ
date
echo "npm"; npm --version
echo "node"; node --version
echo "bids-validator"; bids-validator --version

- name: Validate all BIDS datasets using bids-validator
run: |
pushd ./bids-examples
cat ./run_tests.sh
bash ./run_tests.sh
popd
shell: bash
91 changes: 88 additions & 3 deletions bids-validator/bids_validator/rules/file_level_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,53 @@
},

"eeg": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?eeg[\\/\\\\]\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_split-[0-9]+)?((_eeg\\.(@@@_eeg_type_@@@)|(@@@_eeg_ext_@@@))|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?eeg[\\/\\\\]\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_split-[0-9]+)?(?:_space-(@@@_eeg_space_@@@))?((_eeg\\.(@@@_eeg_type_@@@)|(@@@_eeg_ext_@@@))|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
"tokens": {
"@@@_eeg_space_@@@": [
"Other",
"CapTrak",
"CTF",
"ElektaNeuromag",
"4DBti",
"KitYokogawa",
"ChietiItab",
"ICBM452AirSpace",
"ICBM452Warp5Space",
"IXI549Space",
"fsaverage",
"fsaverageSym",
"fsLR",
"MNIColin27",
"MNI152Lin",
"MNI152NLin2009aSym",
"MNI152NLin2009bSym",
"MNI152NLin2009cSym",
"MNI152NLin2009aAsym",
"MNI152NLin2009bAsym",
"MNI152NLin2009cAsym",
"MNI152NLin6Sym",
"MNI152NLin6ASym",
"MNI305",
"NIHPD",
"OASIS30AntsOASISAnts",
"OASIS30Atropos",
"Talairach",
"UNCInfant",
"fsaverage3",
"fsaverage4",
"fsaverage5",
"fsaverage6",
"fsaveragesym",
"UNCInfant0V21",
"UNCInfant1V21",
"UNCInfant2V21",
"UNCInfant0V22",
"UNCInfant1V22",
"UNCInfant2V22",
"UNCInfant0V23",
"UNCInfant1V23",
"UNCInfant2V23"
],
"@@@_eeg_type_@@@": ["vhdr", "vmrk", "eeg", "edf", "bdf", "set", "fdt"],
"@@@_eeg_ext_@@@": [
"_events\\.json",
Expand All @@ -378,10 +423,50 @@
]
}
},

"ieeg": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?ieeg[\\/\\\\]\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_split-[0-9]+)?(?:_space-[a-zA-Z0-9]+)?((_ieeg\\.(@@@_ieeg_type_@@@)|(@@@_ieeg_ext_@@@))|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?ieeg[\\/\\\\]\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_split-[0-9]+)?(?:_space-(@@@_ieeg_space_@@@))?((_ieeg\\.(@@@_ieeg_type_@@@)|(@@@_ieeg_ext_@@@))|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
"tokens": {
"@@@_ieeg_space_@@@": [
"Other",
"Pixels",
"ACPC",
"ICBM452AirSpace",
"ICBM452Warp5Space",
"IXI549Space",
"fsaverage",
"fsaverageSym",
"fsLR",
"MNIColin27",
"MNI152Lin",
"MNI152NLin2009aSym",
"MNI152NLin2009bSym",
"MNI152NLin2009cSym",
"MNI152NLin2009aAsym",
"MNI152NLin2009bAsym",
"MNI152NLin2009cAsym",
"MNI152NLin6Sym",
"MNI152NLin6ASym",
"MNI305",
"NIHPD",
"OASIS30AntsOASISAnts",
"OASIS30Atropos",
"Talairach",
"UNCInfant",
"fsaverage3",
"fsaverage4",
"fsaverage5",
"fsaverage6",
"fsaveragesym",
"UNCInfant0V21",
"UNCInfant1V21",
"UNCInfant2V21",
"UNCInfant0V22",
"UNCInfant1V22",
"UNCInfant2V22",
"UNCInfant0V23",
"UNCInfant1V23",
"UNCInfant2V23"
],
"@@@_ieeg_type_@@@": [
"edf",
"vhdr",
Expand Down
90 changes: 88 additions & 2 deletions bids-validator/bids_validator/rules/session_level_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},

"eeg_ses": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(@@@_eeg_ses_type_@@@)$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_space-(@@@_eeg_space_@@@))?(@@@_eeg_ses_type_@@@)$",
"tokens": {
"@@@_eeg_ses_type_@@@": [
"_events.tsv",
Expand All @@ -87,12 +87,57 @@
"_eeg.json",
"_coordsystem.json",
"_photo.jpg"
],
"@@@_eeg_space_@@@": [
"Other",
"CapTrak",
"CTF",
"ElektaNeuromag",
"4DBti",
"KitYokogawa",
"ChietiItab",
"ICBM452AirSpace",
"ICBM452Warp5Space",
"IXI549Space",
"fsaverage",
"fsaverageSym",
"fsLR",
"MNIColin27",
"MNI152Lin",
"MNI152NLin2009aSym",
"MNI152NLin2009bSym",
"MNI152NLin2009cSym",
"MNI152NLin2009aAsym",
"MNI152NLin2009bAsym",
"MNI152NLin2009cAsym",
"MNI152NLin6Sym",
"MNI152NLin6ASym",
"MNI305",
"NIHPD",
"OASIS30AntsOASISAnts",
"OASIS30Atropos",
"Talairach",
"UNCInfant",
"fsaverage3",
"fsaverage4",
"fsaverage5",
"fsaverage6",
"fsaveragesym",
"UNCInfant0V21",
"UNCInfant1V21",
"UNCInfant2V21",
"UNCInfant0V22",
"UNCInfant1V22",
"UNCInfant2V22",
"UNCInfant0V23",
"UNCInfant1V23",
"UNCInfant2V23"
]
}
},

"ieeg_ses": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_space-[a-zA-Z0-9]+)?(@@@_ieeg_ses_type_@@@)$",
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?\\1(_\\2)?(?:_task-[a-zA-Z0-9]+)?(?:_acq-[a-zA-Z0-9]+)?(?:_proc-[a-zA-Z0-9]+)?(?:_space-(@@@_ieeg_space_@@@))?(@@@_ieeg_ses_type_@@@)$",
"tokens": {
"@@@_ieeg_ses_type_@@@": [
"_events.tsv",
Expand All @@ -103,6 +148,47 @@
"_ieeg.json",
"_coordsystem.json",
"_photo.jpg"
],
"@@@_ieeg_space_@@@": [
"Other",
"Pixels",
"ACPC",
"ICBM452AirSpace",
"ICBM452Warp5Space",
"IXI549Space",
"fsaverage",
"fsaverageSym",
"fsLR",
"MNIColin27",
"MNI152Lin",
"MNI152NLin2009aSym",
"MNI152NLin2009bSym",
"MNI152NLin2009cSym",
"MNI152NLin2009aAsym",
"MNI152NLin2009bAsym",
"MNI152NLin2009cAsym",
"MNI152NLin6Sym",
"MNI152NLin6ASym",
"MNI305",
"NIHPD",
"OASIS30AntsOASISAnts",
"OASIS30Atropos",
"Talairach",
"UNCInfant",
"fsaverage3",
"fsaverage4",
"fsaverage5",
"fsaverage6",
"fsaveragesym",
"UNCInfant0V21",
"UNCInfant1V21",
"UNCInfant2V21",
"UNCInfant0V22",
"UNCInfant1V22",
"UNCInfant2V22",
"UNCInfant0V23",
"UNCInfant1V23",
"UNCInfant2V23"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion bids-validator/tests/data/bids-examples
Submodule bids-examples updated 2917 files
9 changes: 8 additions & 1 deletion bids-validator/tests/type.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ describe('utils.type.file.isEEG', function() {
'/sub-01/ses-001/eeg/sub-01_ses-001_task-rest_run-01_eeg.fdt',
'/sub-01/ses-001/eeg/sub-01_ses-001_task-rest_run-01_channels.tsv',
'/sub-01/ses-001/eeg/sub-01_ses-001_electrodes.tsv',
'/sub-01/ses-001/eeg/sub-01_ses-001_space-CapTrak_electrodes.tsv',
'/sub-01/ses-001/eeg/sub-01_ses-001_coordsystem.json',
'/sub-01/ses-001/eeg/sub-01_ses-001_space-CapTrak_coordsystem.json',
'/sub-01/ses-001/eeg/sub-01_ses-001_photo.jpg',
]

Expand All @@ -360,6 +362,8 @@ describe('utils.type.file.isEEG', function() {
'/sub-01/eeg/sub-01_ses-001_task-rest_run-01_eeg.json',
'/sub-01/ses-001/eeg/sub-12_ses-001_task-rest_run-01_split-01_eeg.edf',
'/sub-01/ses-001/eeg/sub-01_ses-001_task-rest_run-01_eeg.tsv',
'/sub-01/ses-001/eeg/sub-01_ses-001_space-BOGUS_electrodes.tsv',
'/sub-01/ses-001/eeg/sub-01_ses-001_space-BOGUS_coordsystem.json',
]

badFilenames.forEach(function(path) {
Expand All @@ -386,7 +390,8 @@ describe('utils.type.file.isIEEG', function() {
'/sub-01/ses-001/ieeg/sub-01_ses-001_task-rest_run-01_split-01_ieeg.mefd/CH1.timd/CH1-000000.segd/sub-01_ses-001_task-rest_run-01_ieeg.idx',
'/sub-01/ses-001/ieeg/sub-01_ses-001_task-rest_run-01_split-01_ieeg.mefd/CH1.timd/CH1-000000.segd/sub-01_ses-001_task-rest_run-01_ieeg.tmet',
'/sub-01/ses-001/ieeg/sub-01_ses-001_task-rest_run-01_channels.tsv',
'/sub-01/ses-001/ieeg/sub-01_ses-001_task-rest_run-01_electrodes.tsv',
'/sub-01/ses-001/ieeg/sub-01_ses-001_space-fsaverage_electrodes.tsv',
'/sub-01/ses-001/ieeg/sub-01_ses-001_space-fsaverage_coordsystem.json',
]

goodFilenames.forEach(function(path) {
Expand All @@ -400,6 +405,8 @@ describe('utils.type.file.isIEEG', function() {
'/sub-01/ieeg/sub-01_ses-001_task-rest_run-01_ieeg.json',
'/sub-01/ses-001/ieeg/sub-12_ses-001_task-rest_run-01_split-01_ieeg.fif',
'/sub-01/ses-001/ieeg/sub-01_ses-001_task-rest_run-01_ieeg.tsv',
'/sub-01/ses-001/ieeg/sub-01_ses-001_space-fsavg_electrodes.tsv',
'/sub-01/ses-001/ieeg/sub-01_ses-001_space-fsavg_coordsystem.json',
]

badFilenames.forEach(function(path) {
Expand Down