Skip to content

dataset.modalities and dataset.datatypes are not being populated in the BIDSContextDataset #433

Description

@psadil

So, I think there is a set of warnings that are not currently being triggered, like B0_FIELD_SOURCE_RECOMMENDED

# there is a 'perf' file with .nii.gz extension in a dataset that has fmap data
❯ eza -T bids-examples/asl004
bids-examples/asl004
├── dataset_description.json
├── README
└── sub-Sub1
    ├── anat
    │   ├── sub-Sub1_T1w.json
    │   └── sub-Sub1_T1w.nii.gz
    ├── fmap
    │   ├── sub-Sub1_dir-pa_m0scan.json
    │   └── sub-Sub1_dir-pa_m0scan.nii.gz
    └── perf
        ├── sub-Sub1_asl.json
        ├── sub-Sub1_asl.nii.gz
        ├── sub-Sub1_aslcontext.tsv
        ├── sub-Sub1_asllabeling.jpg
        ├── sub-Sub1_m0scan.json
        └── sub-Sub1_m0scan.nii.gz

# B0FieldIdentifier and B0FieldSource are both missing everywhere
❯ grep -ilv B0Field bids-examples/asl004/**/*json
bids-examples/asl004/dataset_description.json
bids-examples/asl004/sub-Sub1/anat/sub-Sub1_T1w.json
bids-examples/asl004/sub-Sub1/fmap/sub-Sub1_dir-pa_m0scan.json
bids-examples/asl004/sub-Sub1/perf/sub-Sub1_asl.json
bids-examples/asl004/sub-Sub1/perf/sub-Sub1_m0scan.json

❯ deno run -ERWN jsr:@bids/validator --version                                                                                
bids-validator 2.4.1

❯ deno run -ERWN jsr:@bids/validator bids-examples/asl004 --json | jq | grep -i B0_FIELD | wc -l
       0

From what I can see, no construction of a BIDSContextDataset object ends up with populated datatypes and modalities fields, causing selectors like "intersects(dataset.datatypes, ['fmap'])" to always be false (meaning the rule is not applied). Not sure whether there's a schema-blessed way to fill the modalities and datatypes part of the context, but I would have assumed that the constructor for BIDSContextDataset would need to walk the filetree so that the selectors can be evaluated once files start getting validated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions