bids-standard / bids-specification

Brain Imaging Data Structure (BIDS) Specification
https://bids-specification.readthedocs.io/
Creative Commons Attribution 4.0 International
264 stars 154 forks source link

[BUG] Inconsistent level for `MagneticFieldStrength` in sidecar rules of schema #1827

Open nbeliy opened 1 month ago

nbeliy commented 1 month ago

Describe your problem in detail.

In schema/rules/sidecars/mri.yaml, the level for MagneticFieldStrength is stated as recommended, but required for Arterial Spin Labeling, which is inconsistent with levels for other metadata fields, that only provide just level value.

Same issue with NonLinearGradientCorrection below.

Describe what you expected.

The , but required for Arterial Spin Labeling moved into level_addendum, as it is done for other metadata (for. ex EffectiveEchoSpacing)

List of possible inconsitencies

Putting all inconsistencies and possible errors that I found here:

nbeliy commented 1 month ago

Another issue with shema:

Selector for rules/sidecars/mri/MRIScannerHardwareASL is:

datatype == "perf"
suffix == "asl"
intersects([suffix], ["asl", "m0scan"])

Is it applicable only for suffix asl or for both asl and m0scan

effigies commented 1 month ago

level: <level>, <addendum> is an accidental shorthand that takes advantage of the behavior of the validator and the renderer. I'm okay with forcing consistency, though, if you would like to open a PR. If so, would you be able to also update the metaschema? I believe this line is what currently allows the above, and could be removed:

https://github.com/bids-standard/bids-specification/blob/3fd21ff095ecc9ac8e2b7bf092f5ee09e055e45b/src/metaschema.json#L668

effigies commented 1 month ago

For the MRIScannerHardwareASL, the selectors are AND-combined, so the second line should be removed, to allow it to apply to m0scans.

nbeliy commented 1 month ago

Dear, @effigies , I could do do PR, but I still feel quite unfamiliar with the structure of schema. And I'm unsure what is just historical inconsistency and what is made on purpose. For example, sometimes deprecated levels are are written in all caps, and sometimes lowercase, also at some places extensions are selected by match and in other cases, from a list.

As this schema is used to generate BIDS documentation, I'm afraid to brake something.

nbeliy commented 1 month ago

I've updated list of inconsistencies in issue.

Can you confirm that they are indeed problematic, and I will make a PR.