MASILab / Synb0-DISCO

Distortion correction of diffusion weighted MRI without reverse phase-encoding scans or field-maps
https://my.vanderbilt.edu/masi
57 stars 28 forks source link

Bad performance of synb0 - possible solutions? #45

Closed alestella closed 1 year ago

alestella commented 1 year ago

Good morning, Synb0-DISCO developers, I am stuck with a problem I cannot find a way to solve. The Synb0-DISCO runs smoothly on my machine in the docker container in Linux. I successfully completed many reconstructions. However, I also had several unsuccessful synthetic reconstructions. For instance, as you can see in the screenshot below, the ventricles and the area of the corpus callosum are not reconstructed nicely, as if there were two different structures overlapping: Screenshot 2023-03-22 102950

Below is the T1 (I provided it without providing the T1 mask, so that Synb0 would extract it on its own): Screenshot 2023-03-22 103254

And here is the b0 before the distorsion correction. Please, notice how different it is from the synthetized b0: Screenshot 2023-03-22 103335

Am I doing anything wrong? Would you suggest me to do anything different? This is the command I ran in the Terminal: docker run -v "$(pwd)/${ii}/:/INPUTS" -v "$(pwd)/${ii}/:/OUTPUTS" -v "/pathtofreesurferlicense/license.txt/:/extra/freesurfer/license.txt" leonyichencai/synb0-disco:v3.0 And this is the acqparam.txt file that I've used: 0 1 0 0.0633 0 1 0 0.0000 As explained in the guide (the second row is for the synthetic b0).

Any help is much appreciated, thank you in advance!

Diffusion-MRI commented 1 year ago

This is indeed introducing some weird artifacts. Is the first image the synthesized b=0 or the original after distortion correction? A few things to check - first does b0_u.nii.gz look reasonable? This will be the synthesized image, and should be geometrically undistorted. My guess is that this is the first step that failed probably due to the use of bet to skull strip the image within the docker). If this image looks OK, the next thing to look at would be to compare b0_all to b0_all_topup.nii.gz. The first one will show the distorted+synthesized image, whereas the latter will have undistorted+synthesized. In a successful scenario, flipping between the undistorted+synthesized it will be easy to appreciate that they share the same geometry (meaning distortion correction was successful). Based on this QA we can determine the next steps.

alestella commented 1 year ago

Thanks so much for your quick reply. I apologize for replying back so late, I've been sick all week with a terrible flu. I summarize here the results of the various QAs:

  1. b0_u looks like the synthetized b0, and both look not reasonable (with fake anatomy)
  2. flipping between the undistorted+synthesized shows similar anatomy
  3. The T1mask provided by the automated bet (done by Synb0) is indeed not good at all, perhaps due to the conspicuous presence of neck in the original image. I would proceed by masking T1 separately in FSL, so that I have control on this step, and use the proper flag in the command I give to the docker container. I will update you soon! Stella
schillkg commented 1 year ago

Yes this is a good idea and usually the next step - go ahead and mask the T1 and include the appropriate flag. We use FSL bet (with relatively conservative thresholding options) to mask the brain but if that fails then our synthesis algorithm is quite literally guessing where there is no image. Let me know if a pre-masked T1 works. We have seen successful results using synthstrip (which we hope to include within the algorithm in the future).

alestella commented 1 year ago

Good afternoon, I confirm that the cause for failure was a wrongly betted T1 structural image. I did BET separately (removing the neck vessels and correcting for bias field with the -B option), and provided this T1mask in lieu of the T1.nii.gz, and the reconstruction of b0 worked very well. Here is the distorted, original b0: DistortedB0 and here is the beautifully synthesized b0: undistortedB0 whereas, this is the topup-corrected image: topup_corrected

Thank you for your suggestions,

Stella

schillkg commented 1 year ago

This is great to know - and agreed the results look excellent! Was yours a traditional BET call with just the -B option? We are wanting to make our algorithm as robust as possible and want to keep in mind what works and what does not!

Thank you, Kurt

alestella commented 1 year ago

Hi Kurt, thank you for following up. As I originally read in a paper by V.Popescu (10.1016/j.neuroimage.2012.03.074), the best option for BET in multiple sclerosis pts is BET -B f=0.2, if the 3D T1 contains neck voxels. In my case this was not an MS patient, however these same settings worked pretty well. It needs to be verified if f=0.2 could be good enough for all the subjects, I haven't tested it yet. Therefore the FSL command I used was "BET inputimage outputimage -B -f 0.2", which corrects for bias field and removes neck voxels. Here is an example of the T1mask generated automatically by Synb0 for the subject of the previous posts: WrongT1_overT1 whereas, this is the result of the independently run FSL command ("BET inputimage outputimage -B f 0.2"): RightT1_overT1

I am glad if this can be of any help to ameliorate the software performances, and I take the chance to thank you and the other synb0 developers for sharing this powerful software with the scientific community!

Stella