Skip to content

Commit

Permalink
Merge pull request #1546 from Remi-Gau/qmri_top
Browse files Browse the repository at this point in the history
[ENH] add support for qMRI json in top dir
  • Loading branch information
rwblair authored Feb 27, 2023
2 parents 596bb07 + 7e8e846 commit 0cbefce
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
56 changes: 56 additions & 0 deletions bids-validator/bids_validator/rules/top_level_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
"phase1\\.json",
"phase2\\.json",
"fieldmap\\.json",
"TB1DAM\\.json",
"TB1EPI\\.json",
"TB1AFI\\.json",
"TB1TFL\\.json",
"TB1RFM\\.json",
"TB1SRGE\\.json",
"RB1COR\\.json",
"events\\.json",
"scans\\.json",
"samples\\.json",
Expand Down Expand Up @@ -82,6 +89,55 @@
}
},

"VFA_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:echo-[0-9]+_)?(?:flip-[0-9]+_)?(?:part-(mag|phase|real|imag)_)?(@@@_mese_megre_suffixes_@@@)\\.json$",
"tokens": {
"@@@_mese_megre_suffixes_@@@": ["VFA"]
}
},

"megre_mese_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:echo-[0-9]+_)?(?:part-(mag|phase|real|imag)_)?(@@@_mese_megre_suffixes_@@@)\\.json$",
"tokens": {
"@@@_mese_megre_suffixes_@@@": ["MEGRE", "MESE"]
}
},

"irt1_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:inv-[0-9]+_)?(?:part-(mag|phase|real|imag)_)?(@@@_irt1_suffixes_@@@)\\.json$",
"tokens": {
"@@@_irt1_suffixes_@@@": ["IRT1"]
}
},

"mpm_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:echo-[0-9]+_)?(?:flip-[0-9]+_)?(?:mt-(on|off)_)(?:part-(mag|phase|real|imag)_)?(@@@_mpm_suffixes_@@@)\\.json$",
"tokens": {
"@@@_mpm_suffixes_@@@": ["MPM"]
}
},

"mts_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:echo-[0-9]+_)?(?:flip-[0-9]+_mt-(on|off)_)?(?:part-(mag|phase|real|imag)_)?(@@@_mts_suffixes_@@@)\\.json$",
"tokens": {
"@@@_mts_suffixes_@@@": ["MTS"]
}
},

"mtr_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:mt-(on|off)_)?(?:part-(mag|phase|real|imag)_)?(@@@_mtr_suffixes_@@@)\\.json$",
"tokens": {
"@@@_mtr_suffixes_@@@": ["MTR"]
}
},

"mp2rage_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:ce-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(?:echo-[0-9]+_)?(?:flip-[0-9]+_)?(?:inv-[0-9]+_)?(?:part-(mag|phase|real|imag)_)?(@@@_mp2rage_suffixes_@@@)\\.json$",
"tokens": {
"@@@_mp2rage_suffixes_@@@": ["MP2RAGE"]
}
},

"dwi_top": {
"regexp": "^[\\/\\\\](?:ses-[a-zA-Z0-9]+_)?(?:acq-[a-zA-Z0-9]+_)?(?:rec-[a-zA-Z0-9]+_)?(?:run-[0-9]+_)?(dwi\\.(?:@@@_dwi_top_ext_@@@)|sbref\\.json)$",
"tokens": {
Expand Down
21 changes: 21 additions & 0 deletions bids-validator/utils/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ const rootTop = buildRegExp(top_level_rules.root_top)
const funcTop = buildRegExp(top_level_rules.func_top)
const aslTop = buildRegExp(top_level_rules.asl_top)
const anatTop = buildRegExp(top_level_rules.anat_top)
const vfaTop = buildRegExp(top_level_rules.VFA_top)
const megreTop = buildRegExp(top_level_rules.megre_mese_top)
const irt1Top = buildRegExp(top_level_rules.irt1_top)
const mpmTop = buildRegExp(top_level_rules.mpm_top)
const mtsTop = buildRegExp(top_level_rules.mts_top)
const mtrTop = buildRegExp(top_level_rules.mtr_top)
const mp2rageTop = buildRegExp(top_level_rules.mp2rage_top)
const dwiTop = buildRegExp(top_level_rules.dwi_top)
const eegTop = buildRegExp(top_level_rules.eeg_top)
const ieegTop = buildRegExp(top_level_rules.ieeg_top)
Expand Down Expand Up @@ -141,6 +148,13 @@ export default {
aslTop.test(path) ||
dwiTop.test(path) ||
anatTop.test(path) ||
vfaTop.test(path) ||
megreTop.test(path) ||
irt1Top.test(path) ||
mpmTop.test(path) ||
mtsTop.test(path) ||
mtrTop.test(path) ||
mp2rageTop.test(path) ||
multiDirFieldmap.test(path) ||
otherTopFiles.test(path) ||
megTop.test(path) ||
Expand All @@ -157,6 +171,13 @@ export default {
aslTop.test(path) ||
dwiTop.test(path) ||
anatTop.test(path) ||
vfaTop.test(path) ||
megreTop.test(path) ||
irt1Top.test(path) ||
mpmTop.test(path) ||
mtsTop.test(path) ||
mtrTop.test(path) ||
mp2rageTop.test(path) ||
multiDirFieldmap.test(path) ||
otherTopFiles.test(path) ||
megTop.test(path) ||
Expand Down

0 comments on commit 0cbefce

Please sign in to comment.