-
Notifications
You must be signed in to change notification settings - Fork 179
[ENH] Specify that dir-<label> should correspond to PhaseEncodingDirection #2097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -49,3 +49,18 @@ XformCodes0: | |||||
- nifti_header != null | ||||||
checks: | ||||||
- nifti_header.qform_code != 0 || nifti_header.sform_code != 0 | ||||||
|
||||||
NiftiPEDir: | ||||||
issue: | ||||||
code: NIFTI_PE_DIRECTION_CONSISTENCY | ||||||
message: | | ||||||
Phase encoding direction is inconsistent with `dir-` entity. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not make this a confident statement:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not opposed to this, but I don't understand the case where this is triggered and the direction isn't inconsistent. We can expand on this text to explain why it's inconsistent in general terms, though we don't have a way to vary the text based on the values of fields. |
||||||
level: warning | ||||||
selectors: | ||||||
- type(nifti_header.axis_codes) != "null" | ||||||
- intersects([entities.direction], ["AP", "PA", "RL", "LR", "SI", "IS"]) | ||||||
- sidecar.PhaseEncodingDirection | ||||||
checks: | ||||||
- | | ||||||
entities.direction[2 - length(sidecar.PhaseEncodingDirection)] | ||||||
== nifti_header.axis_codes[index(["i", "j", "k"], sidecar.PhaseEncodingDirection[0])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is introducing a new RECOMMENDation that entity values should not indicate the values of the associated metadata. This is not generally stated in BIDS, and runs counter to common usage; if you would like to make that proposal, I would probably start an issue or a mailing list thread to see if there's much support for it.
I don't want to try to introduce it here. Beyond it being out-of-scope for this fairly narrow attempt to warn on inconsistency, it would introduce a warning even when the metadata is consistent, which seems user-hostile.
That said, we can expand the previous "Please note that the
<label>
does not need to match the actual value of the field." into a brief discussion of non-axis-code conventions: