bids-standard / legacy-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/legacy-validator/
MIT License
186 stars 111 forks source link

BIDS Specification is different than bids-validator for non-parametric structural MR images #1861

Closed Slevinski closed 3 weeks ago

Slevinski commented 11 months ago

The BIDS Specification allows for echo and chunk with non-parametric structural MR images. The bids-validator does not.

bids-validator https://github.com/bids-standard/bids-validator/blob/1163824c837910ba6ceebc38e3098438221f8bf1/bids-validator/bids_validator/rules/file_level_rules.json#L3

BIDS Specification Modality specific files section and the Entity Table appendix. https://bids-specification.readthedocs.io/en/stable/modality-specific-files/magnetic-resonance-imaging-data.html#non-parametric-structural-mr-images https://bids-specification.readthedocs.io/en/stable/appendices/entity-table.html

For the bids-validator, the new line should be:

  "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))?(?:_chunk-[0-9]+)?_(?:@@@_anat_suffixes_@@@)\\.(@@@_anat_ext_@@@)$",
effigies commented 11 months ago

Thanks for the bug report! Would you be willing to submit a PR with your proposed fix?

Slevinski commented 11 months ago

Sure, I modified the regex and created a pull request. https://github.com/bids-standard/bids-validator/pull/1863