[Python] Why does MP-PCA denoising with DIPY cause black regions to appear in my GRE MRI data?

Discussão em 'Python' iniciado por Stack, Abril 25, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using DIPY's mppca function to denoise 4D GRE MRI data with shape (256, 224, 176, 6), where the last dimension represents 6 echo times.

    The original data (noisy_real_all) looks fine, and the signal exists across all echoes at the voxel of interest. However, after denoising, some regions become completely black (i.e., voxel values are zero for multiple echoes).

    Here's a minimal reproducible example:

    import scipy.io as sio
    import napari
    import matplotlib.pyplot as plt

    from dipy.denoise.localpca import mppca

    # .mat file load
    mat_data = sio.loadmat("noisy_meas_gre_dir1.mat")
    noisy_real_all = mat_data["noisy_real"] # shape: (256, 224, 176, 6)
    noisy_imag_all = mat_data["noisy_imag"] # shape: (256, 224, 176, 6)
    mask_brain = mat_data["mask_brain"]

    denoised_real = mppca(noisy_real_all, patch_radius=2, mask=mask_brain)

    x, y, z = 120, 100, noisy_real_all.shape[2] // 2
    print("Echo values at denoised_real (x, y, z):", denoised_real[x, y, z, :])


    Even though the original voxel had valid signal across all echoes, the denoised result is:

    Denoised values: [0.36381117 0. 0. 0. 1.4625514 1.3720925]


    I'v tried this:


    • Verified that the original signals are not zero.


    • Applied mppca() with proper 3D mask (not 4D).


    • Tried dilating the brain mask.


    • Tried per-echo denoising (slicing data along last axis and adding dummy 4th dim).

    Still, this zeroing behavior persists in the mid-echoes, which appears as black areas after denoising.

    Why does mppca() return zero for some echoes even when the input data has valid signal? Is this expected behavior (e.g., due to low patch variance)? If so, how can I avoid or mitigate these black regions?

    Continue reading...

Compartilhe esta Página