I’m trying to validate a BIDS dataset and I’m getting an error that the T2starw files are NOT_INCLUDED.
The reason seems to be that the BIDS Specification allows for echo with T2Starw but the bids-validator does not. I guess this would be true for all non-parametric structural MR images.
Example file:
rawdata/sub-142/ses-60238918/anat/sub-142_ses-60238918_acq-T2MAPGRE_echo-0_T2starw.nii.gz
bids-validator regexp for T2starw does not allow for “echo”
{
"anat_nonparametric": {
"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]+)?(?:_part-(imag|mag|phase|real))?_(?:@@@_anat_suffixes_@@@)\\.(@@@_anat_ext_@@@)$",
"tokens": {
"@@@_anat_suffixes_@@@": [
"T1w",
"T2w",
"PDw",
"T2starw",
"FLAIR",
"inplaneT1",
"inplaneT2",
"PDT2",
"angio",
"T2star",
"FLASH",
"PD"
],
"@@@_anat_ext_@@@": ["nii\\.gz", "nii", "json"]
BIDS Specification for T2starw does allow for “echo” in both the 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
The easy solution seems to be to change the “echo” to “run” and bump the index up by 1.
Thoughts or opinions?
I guess I could also create an issue with the bids-validator or modify the offending bids-validator file and submit a patch.
Please do. If the spec allows it and the validator doesn’t, that’s a bug and should be handled on the issue tracker.
I have entered an issue on github. I also noticed that chunk should be allowed as well.
opened 08:42PM - 14 Dec 23 UTC
The BIDS Specification allows for **echo** and **chunk** with non-parametric str… uctural 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_@@@)$",
1 Like
Also create pull request with the fix.
bids-standard:master
← Slevinski:issue-1861-fix
opened 10:02PM - 14 Dec 23 UTC
I have updated the regex in the appropriate file to fix issue 1861.