datahipy.bids.validation module
Functions for validating BIDS datasets.
- datahipy.bids.validation.add_bidsignore_validation_rule(bids_dir, rule)[source]
Create/update a
bidsignore
file to ignore specific files by the BIDS Validator.Parameters
- bids_dirstr
Path to the BIDS dataset.
- rulestr
Rule to add to the
bidsignore
file, e.g. “**/_ct.” to ignore all CT files.
- datahipy.bids.validation.get_bids_validator_output_info(bids_dir, bids_schema_version=None)[source]
Run the bids-validator on the dataset with the specified schema version and the option to ignore subject consistency.
Parameters
- bids_dirstr
Path to the BIDS dataset.
- bids_schema_versionstr
BIDS schema version to use for the validation. (e.g. “v1.7.0”)
Returns
- bids_validator_output_infodict
Dictionary containing the bids-validator output to be integrated in the dataset content to be indexed.
- datahipy.bids.validation.validate_bids_dataset(container_dataset_path, *args)[source]
Validate a BIDS dataset using the BIDS Validator.
Parameters
- container_dataset_pathstr
Path to the BIDS dataset
- argslist
List of options to pass to the
bids-validator
. Can be used to ignore warnings (["--ignoreWarnings"]
) or nifti headers (["--ignoreNiftiHeaders"]
) or to skip checking that any given file for one subject is present for all other subjects (["--ignoreSubjectConsistency"]
) or to use a specific BIDS schema (["-s", "v1.6.0"]
)
Returns
- outputdict
Output of the bids-validator as a dictionary.
- return_codeint
Return code of the bids-validator.