dwidenoise applied to complex data

Hi,

I have phase and magnitude data acquired with a Siemens PRISMA scanner at a reasonably low SNR. I tried applying dwidenoise in the complex data but I am not sure it is performing better. For instance, I can see the noise floor reduced in some parts and maybe less blurriness when denoising the complex data, but it also returns lower SNR/CNR and visually looks noisier than denoising the magnitude data. I wonder whether this is the behaviour expected or I am doing something wrong. So far, I followed similar steps commented on in previous forum entries (Unwrapping before dwidenoise on complex-valued data) or your guidelines (https://readthedocs.org/projects/mrtrix/downloads/pdf/latest/):

  1. Rescale phase from (-4096:4096) to (0,2pi).
  2. mrcalc Mag.nii.gz Ph_rad.nii.gz -polar complex.nii.gz
  3. dwidenoise complex.nii.gz denoised.nii.gz -noise noisemap.nii.gz
  4. mrcalc denoised.nii.gz -abs abs_denoised.nii.gz

Attached is a screenshot of what I get when applied to magnitude vs complex data.

Thank you so much for your help!

Hi @josepman,

OK, that’s clearly not what we would have expected… My guess is that the initial conversion of the phase is not quite right, but I have to admit there may be more going on. I’ve looked into this a bit yesterday as we are also in the process of setting up a protocol here, here are my findings so far (I’ll need to dig deeper in due course, but that’ll have to wait till after the Easter break).

I’ve tested 3 cases, all on the same 1.3mm isotropic, b = 0, 1000, 2500 s/mm², 131 volume 7T dataset:

  • magnitude data only
  • complex with phase correctly converted. This rescales the data from [ -4096 4096 ) to [ -π π ) (should be equivalent to [ 0 2π )). This was done using this command:
    mrcalc DICOM_DWI_mag/ DICOM_DWI_phase/ pi 4096 -div -mult -polar dwi_complex_correct.nii
    
  • complex with the incorrect phase conversion. This rescales the data from [ 0 4096 ) to [ 0 2π ) – which is likely correct for some datasets, but as it happens, not for this one… This was done using this command:
    mrcalc DICOM_DWI_mag/ DICOM_DWI_phase/ 2 pi -mult 4096 -div -mult -polar dwi_complex.nii
    

The results look like this:

DW volumes

two examples – all on the same intensity scale:

Noise maps:

All on the same intensity scale:


What does this tell us?

Main take-home points:

  • if the phase is not converted correctly, the estimated noise level is higher, and the images produced appear somewhat noisier (compared to magnitude or correctly-converted complex), and it looks like the intensity itself is lower than expected in places.

  • if the phase is correctly converted, the estimated noise level is similar to that estimated from the magnitude data – if anything, very slightly higher. But the images produced appear significantly noisier than those from the magnitude data.

  • the Rician / magnitude noise bias is considerably lower using complex data – as expected.

So all in all, it looks like the initial phase conversion could be an issue (hard to tell from what you show without knowing the intensity scale on the noise map), but even with the correct phase, the denoised complex images do indeed appear slightly noisier than I would have expected, based on my experiences a while back when we were initially tinkering with these concepts (quite a few years ago now…). So I will be looking into this more closely when I next get the chance…

Any thoughts about this, @dchristiaens…?

Cheers!
Donald.

Quick update on this topic while I have a minute…

It looks like the essential step missing for complex denoising to work well is the phase correction. There are different ways of implementing this step, but the simplest is probably just to run a first pass MP-PCA on the complex DWI, then use the phase of this output to correct the phase of the raw DWI, then run MP-PCA again on that (steps to reproduce below).

With this, I get these outputs:


These correspond to the (top to bottom):

  • original magnitude data
  • magnitude data, denoised using regular MP-PCA
  • complex data, denoised as-is using complex MP-PCA, followed by magnitude transform
  • complex data, phase-corrected from first-pass complex MP-PCA, then denoised again using complex MP-PCA, followed by magnitude transform

You can see that the phase correction really seems to help here, and provides outputs that are visually at least as clean as magnitude MP-PCA, but with better rectification of the noise floor.

For reference, these are the corresponding noise maps produced:

Cheers,
Donald.


Steps to reproduce:

  1. convert DICOM data to complex
  2. run first-pass complex MP-PCA
  3. correct phase of original data based on phase of first-pass MP-PCA run
  4. run second-pass MP-PCA on phase-corrected data
  5. perform final magnitude transform

These are implemented below assuming magnitude & phase DICOM data stored in the DICOM_DWI_mag and DICOM_DWI_phase folders respectively:

mrcalc DICOM_DWI_mag/ DICOM_DWI_phase/ pi 4096 -div -mult -polar complex.mif
dwidenoise complex.mif complex_dn.mif -noise noisemap.mif
mrcalc complex.mif complex_dn.mif complex_dn.mif -abs -div -conj -mult complex_pc.mif
dwidenoise complex_pc.mif denoised_pc_dn.mif -noise noisemap_pc.mif
mrcalc denoised_pc_dn.mif -abs denoised_pc_dn_mag.mif

Dear Donald,

thank you for providing the steps to use complex denoising with phase correction.

Going back to this thread after more than three years I would like to ask if this is still the recommended procedure.

Also I don’t quite understand this line of code:

I mean I understand the individual operations and their order, but don’t grasp the concept (how are these operations able to correct the phase of the the original data… and why does it need correction in the first place :slight_smile: )

I would like to include complex denoising in our pipeline (we are doing a large connectome study) but first I would like to understand it a bit more.

If you or anyone from the team could elaborate on this I will be very thankful.

Best regards

Samuel

Hi Samuel

I’ve not attempted the two-pass phase demodulation proposed here. I have however had to do a fair bit of experimentation around phase demodulation for complex data denoising. I’d be slightly concerned that this approach may have a stationary point problem. If the first denoising pass is ineffective, ie. the denoised data are similar to the empirical data, then demodulating by that image will place all of the signal on the real axis, and the fundamental expectation of complex PCA (equal variance on real and imaginary axes) will be violated.

My updated implementation includes complex phase demodulation as an integrated feature of the command, with multiple approaches available for doing so. Feel free to experiment if you so choose.

Rob

Dear Rob,

Thank you very much. Even though I don’t have enough knowledge to fully understand the technical/mathematical side of things, I will definitely try out dwidenoise2 on my data and see how it does.

I see it is already available as an option in the latest version of QSIprep, which is great. I will use it within this framework.

Best regards

Samuel