qsiprep icon indicating copy to clipboard operation
qsiprep copied to clipboard

[WIP / ENH] Add Synb0-DisCo as a SYN Unwarp Method

Open smeisler opened this issue 1 year ago • 10 comments

Changes proposed in this pull request

Addresses #90. Add Synb0-DisCo (paper, github) as an unwarping method.

SynB0-DisCo is being incorporated in the next release of DIPY, so the Python-ized version of this might be easier to incorporate into QSIPrep and provide advantages over the current ANTs implementation.

At a high level, I imagine the workflow would be something like

  1. Grab the best b0 (i.e., get_best_b0_topup_inputs_from) (Maybe we have to register b0 to T1?)
  2. Use the b0 and T1 to synthesize a RPE DWI contrast image using Synb0-DisCo
  3. Ingress that into whatever unwarping software is requested (TOPUP, 3dQWarp, DRBUDDI)

It would operate different from the ANTs method, which is pretty much its own workflow. This would be an intermediary step preceding the normal unwarping methods.

I will also ping @schillkg who developed the algorithm for additional insight.

smeisler avatar Apr 11 '23 15:04 smeisler

I love this idea. But I would recommend holding off on seriously coding for another week or so. I'm totally redoing the anatomical data workflow so users can specify whether they want to use a T1w or T2w as their anatomical reference. And the skull stripping and segmentation are going to be done by synthstrip and synthseg respectively. Anyways, the workflow will look very different soon, but once it's ready we should definitely give this a go!

mattcieslak avatar Apr 11 '23 16:04 mattcieslak

@smeisler I've been thinking about this one - how familiar are you with the workflow? I'm assuming the topup step happens before Eddy? I also wonder if the outputs from this could be used by DRBUDDI. I believe @eurotomania has used Synb0 with DRBUDDI with good results.

There may have to be two different workflows for synb0 disco depending on whether it's run with Eddy or SHORELine

mattcieslak avatar May 01 '23 14:05 mattcieslak

I definitely want to use this feature, happy to test things

cookpa avatar May 01 '23 14:05 cookpa

@mattcieslak The idea (@schillkg correct me if I am wrong) is that we can use Synb0 only to make a synthesized RPE b0-like image that would then be tunneled into whatever SDC workflow is requested. While the dockerized synb0-DISCO workflow may go through all of the SDC steps, the DIPY version should be a bit more modular, enabling us to do only the synthesis step.

smeisler avatar May 01 '23 14:05 smeisler

Hello,

That is pretty much how I use it.

I use the b=0 and T1W images in SynB0-Disco to generate a b=0 contrast undistorted T2W image. Then I give this image as a constraint to TORTOISE's DRBUDDI.

I like the results in general but one should check the quality of this image before proceeding. If your T1W or b=0 image gas a contrast that wasnt used in training, the results arent that good.

On Mon, May 1, 2023 at 10:54 AM Steven Meisler @.***> wrote:

@mattcieslak https://github.com/mattcieslak The idea @.*** https://github.com/schillkg correct me if I am wrong) is that we can use Synb0 only to make a synthesized RPE b0-like image that would then be tunneled into whatever SDC workflow is requested. While the dockerized synb0-DISCO workflow may go through all of the SDC steps, the DIPY version should be a bit more modular, enabling us to do only the synthesis step.

— Reply to this email directly, view it on GitHub https://github.com/PennLINC/qsiprep/pull/546#issuecomment-1529796386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFQZWB567KIC6U7UH64NDDXD7FCNANCNFSM6AAAAAAW2NHEGA . You are receiving this because you were mentioned.Message ID: @.***>

-- M. Okan Irfanoglu Graduate Student & GTA Computer Sciences & Engineering Ohio State University

eurotomania avatar May 01 '23 14:05 eurotomania

And here is a relevant part from the paper, so looks like TOPUP before EDDY:

Distortion correction was performed by first applying the trained network to a given MPRAGE dataset, resulting in the synthesized b0 image. The synthesized b0 was rigidly registered to the real b0 image (note that these will not, and do not have to, align perfectly as both motion and susceptibility distortions are estimated with TOPUP), and concatenated, which formed the input to TOPUP. TOPUP was then run on the merged b0 volume. Importantly, when setting up the acquisition parameters, the readout time (i.e., time between the center of the first echo and center of last echo) for the synthesized image is set to 0 (while the real b0 retains the correct readout time). This tells the algorithm that the synthesized b0 has an infinite bandwidth in the PE direction, with no distortions, thus fixing its geometry when estimating the susceptibility field. After this, conventional processing is performed, including eddy current correction (FSL eddy) and non-linear least squares diffusion tensor fitting and fractional anisotropy (FA) calculation.

smeisler avatar May 01 '23 14:05 smeisler

The docker implementation from the MASI lab will also output just the image if requested. Running topup is on by default but optional.

cookpa avatar May 01 '23 14:05 cookpa

@smeisler yes that is likely how it should be integrated into other packages. We've made available a --notopup flag with this in mind where we do not complete the full SDC pipeline. You can grab the synthesized image in native space (b0_u.nii.gz), or the combination of distorted+synthesized image (b0_all.nii.gz) and use as an input to your chosen package. Agree that the DIPY package may be more modular, but should be possible using both DIPY and this already existing docker/singularity.

schillkg avatar May 01 '23 15:05 schillkg

Ok, this is great! We can run the b0-synthesizing in the anatomical workflow where it will be accessible to all the dmri processing downstream.

mattcieslak avatar May 01 '23 15:05 mattcieslak

Any update on this pull request ? This feature would be a great addition

DelinteNicolas avatar Jul 04 '24 13:07 DelinteNicolas