Skip to content
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

[ENH] MRI: Improve definition of bvec file #1811

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

Lestropie
Copy link
Collaborator

Closes #243.

Making an attempt to resolve this issue as ensuring that the definition here is robust and consistent across different softwares will be essential to verifying the definition of orientation encoding for BEP016 MRI diffusion models.

References:

  • FSL documentation
  • Implementation changes we made to MRtrix3 on load and save
  • Announcement on the MRtrix3 community forum regarding how our prior support for this format was flawed and how it was fixed.

I'm listing this as a draft PR as it's entirely possible that the phrasing can be fine-tuned. Pinging @jdtournier; if anyone knows of an appropriate person from FMRIB to ping please do so.

One note here is that I've intentionally avoided the use of "radiological" vs. "neurological" coordinate systems. I've always thought of these as being in reference to two-dimensional projections of image data. There seems to be some confusion about which of these terms apply in reference to three-dimensional coordinate systems. Therefore I chose to stick to "left-handed vs. right-handed" / "positive vs. negative determinant". Not strictly against use of such terms, but the ambiguity would need to be resolved.

Copy link

codecov bot commented May 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.22%. Comparing base (0de4c9c) to head (63c82e9).
Report is 44 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1811   +/-   ##
=======================================
  Coverage   88.22%   88.22%           
=======================================
  Files          16       16           
  Lines        1393     1393           
=======================================
  Hits         1229     1229           
  Misses        164      164           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jdtournier
Copy link

Looks good to me. I might suggest a very minor rewording, but it might be more a matter of personal preference than clarity...

This sentence:

Further, if the rotation component of the NIfTI image header transformation possesses a positive determinant (a "right-handed" coordinate system), then the sign of the first element of each 3-vector must be inverted to be interpreted as cosines with respect to the first image axis orientation.

Modify to:

Moreover, if the image axes defined in the corresponding NIfTI image header form a right-handed coordinate system (in other words, the 3×3 matrix of direction cosines has a positive determinant), then the sign of the first element of each 3 vector must be inverted before any further interpretation.

In fact, I'd be tempted to mention this particular aspect before describing the interpretation as relative to the image axes, to ensure that there is no confusion about when the sign flip takes place: it applies to the original entry in the bvec table, not the x-component following transformation into scanner space or something.

I would also have a more upfront statement about the fact that bvecs are relative to some reference image, maybe in the second sentence, with something like:

In this format, the gradient directions are specified relative to a reference image, which must also be provided in order to correctly interpret the information.

As it stands, the fact that the reference image must be supplied is implicit from the later discussion, but in my opinion it's a really important consideration that deserves to be stated very upfront.

@jdtournier
Copy link

if anyone knows of an appropriate person from FMRIB to ping please do so

Maybe Mark Jenkinson, @markj789?

@Lestropie
Copy link
Collaborator Author

Had a go at some minor tweaks. The directions being defined with respect to the image axes is stated explicitly twice, and the ordering of statements about flipping of first element / contrast against DICOM convention is hopefully better.

@Lestropie Lestropie marked this pull request as ready for review May 13, 2024 00:39
@Lestropie
Copy link
Collaborator Author

Marked as ready for review.

Co-authored-by: Christopher J. Markiewicz <[email protected]>
Copy link
Member

@tsalo tsalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattcieslak and I discussed this and it looks good to us.

@effigies
Copy link
Collaborator

Thanks @Lestropie for the PR, and thanks all for the reviews!

@effigies effigies merged commit ace8d7d into bids-standard:master Aug 22, 2024
27 checks passed
@Lestropie Lestropie deleted the mri_bvec_definition branch August 23, 2024 00:07
@effigies effigies changed the title MRI: Improve definition of bvec file [ENH] MRI: Improve definition of bvec file Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete description of DWI bvecs format
5 participants