Validating a BIDS datasetΒΆ

Another core functionality ancpBIDS is to test whether a dataset adheres to BIDS. This process is called validation and ancpBIDS provides some basic functionality for it. We are working on improving this further and making it more expressive.

from ancpbids import fetch_dataset, BIDSLayout, validate_dataset
# fetch fMRI dataset
dataset_path = fetch_dataset('ds005')
layout = BIDSLayout(dataset_path)
report = validate_dataset(layout.dataset)
for message in report.messages:
    print(message)
if report.has_errors():
    print("The dataset contains validation errors, cannot continue.")
from ancpbids import fetch_dataset, BIDSLayout, validate_dataset
# fetch MEG dataset
dataset_path = fetch_dataset('ds003483')
layout = BIDSLayout(dataset_path)
report = validate_dataset(layout.dataset)
for message in report.messages:
    print(message)
if report.has_errors():
    print("The dataset contains validation errors, cannot continue.")