Skip to content

Commit

Permalink
Merge pull request #2165 from rwblair/legacy_fix_anat_physio
Browse files Browse the repository at this point in the history
add continous regex for anatomical datatype to file_level_rules.json
  • Loading branch information
effigies authored Oct 17, 2024
2 parents b85c545 + b1d50c8 commit bec5fea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions bids-validator/bids_validator/rules/file_level_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@
"@@@_anat_ext_@@@": ["nii\\.gz", "nii", "json"]
}
},
"anat_cont": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?anat[\\/\\\\]\\1(_\\2)?(?:_task-[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-(imag|mag|phase|real))?(?:_recording-[a-zA-Z0-9]+)?(?:_chunk-[0-9]+)?(?:@@@_cont_ext_@@@)$",
"tokens": {
"@@@_cont_ext_@@@": [
"_physio\\.tsv\\.gz",
"_stim\\.tsv\\.gz",
"_physio\\.json",
"_stim\\.json"
]
}
},

"behavioral": {
"regexp": "^[\\/\\\\](sub-[a-zA-Z0-9]+)[\\/\\\\](?:(ses-[a-zA-Z0-9]+)[\\/\\\\])?beh[\\/\\\\]\\1(_\\2)?_task-[a-zA-Z0-9]+(?:_acq-[a-zA-Z0-9]+)?(?:_run-[0-9]+)?((?:@@@_behavioral_ext_@@@)|(?:_recording-[a-zA-Z0-9]+)?(?:@@@_cont_ext_@@@))$",
Expand Down
4 changes: 3 additions & 1 deletion bids-validator/utils/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const anatMultiInv = buildRegExp(file_level_rules.anat_multiinv)
const anatMP2RAGE = buildRegExp(file_level_rules.anat_mp2rage)
const anatVFAMT = buildRegExp(file_level_rules.anat_vfa_mt)
const anatMTR = buildRegExp(file_level_rules.anat_mtr)
const anatCont = buildRegExp(file_level_rules.anat_cont)
const behavioralData = buildRegExp(file_level_rules.behavioral)
const dwiData = buildRegExp(file_level_rules.dwi)
const eegData = buildRegExp(file_level_rules.eeg)
Expand Down Expand Up @@ -242,7 +243,8 @@ export default {
conditionalMatch(anatMultiInv, path) ||
conditionalMatch(anatMP2RAGE, path) ||
conditionalMatch(anatVFAMT, path) ||
conditionalMatch(anatMTR, path)
conditionalMatch(anatMTR, path) ||
conditionalMatch(anatCont, path)
)
},

Expand Down

0 comments on commit bec5fea

Please sign in to comment.