This is a library of helper functions written in Python, for use with BIDS compliant applications written in this language.
The main function determines if a file path is compliant with the BIDS specification.
To install with pip:
python -m pip install bids_validator
To install with conda:
conda install bids-validator
- Open a Python terminal and type:
python
- Import the BIDS Validator package
from bids_validator import BIDSValidator
- Check if a file is BIDS compatible
BIDSValidator().is_bids('/relative/path/to/a/bids/file')
- Note, the file path must be relative to the root of the BIDS dataset, and
a leading forward slash
/
must be added to the file path.
from bids_validator import BIDSValidator
validator = BIDSValidator()
filepaths = ["/sub-01/anat/sub-01_rec-CSD_T1w.nii.gz", "/sub-01/anat/sub-01_acq-23_rec-CSD_T1w.exe"]
for filepath in filepaths:
print(validator.is_bids(filepath)) # will print True, and then False
Note, the file path must be relative to the root of the BIDS dataset, and a
leading forward slash /
must be added to the file path.
Many contributions to the bids-validator
were done by members of the
BIDS community. See the
list of contributors.
A large part of the initial development of bids-validator
was done by
Squishymedia, who are in turn financed through
different grants offered for the general development of BIDS. See the list
below.
Development and contributions were supported through the following federally funded projects/grants:
- BIDS Derivatives (NIMH: R24MH114705, PI: Poldrack)
- OpenNeuro (NIMH: R24MH117179, PI: Poldrack)
- Spokes: MEDIUM: WEST (NSF: 1760950, PI: Poldrack & Gorgolewski)
- ReproNim (NIH-NIBIB P41 EB019936, PI: Kennedy)
This project follows the all-contributors specification. Contributions of any kind are welcome!
The project is maintained by @rwblair with the help of many contributors listed below. (The emoji key is indicating the kind of contribution)
Please also see Acknowledgments.