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

Supporting input DWI data on different voxel grids #123

Open
Lestropie opened this issue Mar 20, 2023 · 3 comments
Open

Supporting input DWI data on different voxel grids #123

Lestropie opened this issue Mar 20, 2023 · 3 comments

Comments

@Lestropie
Copy link
Collaborator

Lestropie commented Mar 20, 2023

Need to be able to support data for which execution otherwise fails with this error.

  1. Wait until denoising and Gibbs ringing removal have been completed
  2. Define the average header across all DWIs
  3. Resample all DWI data onto that grid
    If all voxel sizes are identical, then this can be done using mrtransform -replace; if not, then mrtransform -template will be necessary
    Ensure that gradient directions are rotated accordingly
    Ensure that phase encoding directions remain faithful
  4. If necessary, also resample any fmap/ images onto the same image grid
    (there are already cases where this can occur, but if step 4 above is invoked then this is guaranteed to be necessary)
@Lestropie
Copy link
Collaborator Author

Consider implementing as a feature in MRtrix3's dwicat.

@Lestropie
Copy link
Collaborator Author

Lestropie commented Aug 31, 2023

Note that by implementing the necessary functionality in MRtrix3's dwicat, and then utilising that script here to deal with voxel grid differences, #64 will be closed.

@Lestropie
Copy link
Collaborator Author

Dealing with fmap/ images may be a little trickier than first anticipated.

A susceptibility field map can only be used reliably by eddy if the first volume of the input to topup is the same as the first volume of the input to eddy. There is some existing trickery within dwifslpreproc to deal with this; for instance, inserting the first DWI b=0 volume into the SE-EPI series to pass to eddy, and resampling the series provided via -se_epi to the DWI voxel grid if necessary. However the changes to dwicat potentially make this even more complex. Because we're no longer just dealing with voxel grid differences: dwicat may have actually moved the image content in space, particularly in the avoidance of interpolation to concatenate data from multiple series with different header transforms.

So I think maybe what needs to be done is:

  1. For each fmap/ image:
    1. Calculate affine transformation from fmap/ image to concatenated DWIs
    2. Extract rigid component of that transformation
    3. Apply rigid transformation without resampling
  2. Attempt to concatenate all transformed fmap/ images
  3. If step 2. above does not work:
    1. For each fmap/ image:
      1. Interpolate transformed image from step 1.iii. onto DWI voxel grid
    2. Concatenate all fmap/ images

For step 3.i.a., I think that it should be the transformed images that get resampled and not the originals:

  • In the new dwicat there's a certain presumption of centredness of the head within each individual image FoV, such that aligning the FoVs makes sense rather than assuming that the head has remained centred in scanner space and the FoVs mismatch erroneously.
  • This is more likely to preserve the meaning of eg. susceptibility distortions being along the phase encoding axis; without that rigid-body transformation, it would be impossible for all phase encoding directions of all concatenated fmap/ images to be perfectly axis-aligned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant