From 5e55ceeb029ddb170f66f80c2c136475d8700d4b Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Thu, 17 Oct 2024 09:31:27 -0500 Subject: [PATCH 1/2] add continous regex for anatomical datatype to file_level_rules.json --- .../bids_validator/rules/file_level_rules.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bids-validator/bids_validator/rules/file_level_rules.json b/bids-validator/bids_validator/rules/file_level_rules.json index 360027e4a..291c4c6c2 100644 --- a/bids-validator/bids_validator/rules/file_level_rules.json +++ b/bids-validator/bids_validator/rules/file_level_rules.json @@ -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_@@@))$", From b1d50c81529dbe13824428baccfaa9ad390721be Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Thu, 17 Oct 2024 09:43:10 -0500 Subject: [PATCH 2/2] load new regex in utils/type.js --- bids-validator/utils/type.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bids-validator/utils/type.js b/bids-validator/utils/type.js index 98de0b88c..9a2315496 100644 --- a/bids-validator/utils/type.js +++ b/bids-validator/utils/type.js @@ -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) @@ -242,7 +243,8 @@ export default { conditionalMatch(anatMultiInv, path) || conditionalMatch(anatMP2RAGE, path) || conditionalMatch(anatVFAMT, path) || - conditionalMatch(anatMTR, path) + conditionalMatch(anatMTR, path) || + conditionalMatch(anatCont, path) ) },