Removing background noise from MP2RAGE images

Since a previous scanner software upgrade, the MP2RAGE sequence on the 7T does not produce the UNI-DEN (background-noise removed, T1w-like image) automatically. But you can generate it from the data that is acquired.

Here are a few options for this:

  1. Use tar2bids to a dicom tarball to bids, as it has this extra step built in. The docker container is at docker://khanlab/tar2bids:latest
  2. Use the standalone Python script that Option 1 has, which can be found here:
  3. Use the equivalent MATLAB script, located here:

Usage: python MP2RAGE_filenameUNI MP2RAGE_filenameINV1 MP2RAGE_filenameINV2 MP2RAGE_uniden_output_filename [multiplyingFactor]

(default=6, increase up to 10 for more noise suppression)

adapted from RobustCombination function from Jose Marques,
this function shows one possible implementation of the methods suggested

Another option, as well as some additional MP2RAGE cleaning steps (e.g., removal of pads, skullstripping) can be found here:

Works pretty good!

I’m trying to run the matlab version, and I am getting the following error:

>> mp2rage_genUniDen('sub-CW20_acq-UNI_run-01_MP2RAGE.nii.gz','sub-CW20_inv-1_run-01_MP2RAGE.nii.gz','sub-CW20_inv-2_run-01_MP2RAGE.nii.gz','output_8.nii.gz',8);
using multiplying factor of 8
Error using  .* 
Integers can only be combined with integers of the same class, or scalar

Error in mp2rage_genUniDen (line 49)

Any suggestions as to what might be going wrong?


Does it run successfully for you with the default multiplying factor? If so, then the problem may be elsewhere…

I just tried running the matlab version using the default multiplying factor, and I get the same error. (I did get the python version from tar2bids up and running.)

For those who may be switching over to using MP2RAGE on the CFMM 3T, a bit of trial and error suggests that using a multiplying factor of 300 produces effective background suppression.

There is also a new tar2bids container, tar2bids:uniden3T, that includes a new argument, -U, where one can specify a custom multiplying factor.

The default multiplying factor in tar2bids is set to 6, the optimal value for background suppression for the 7T MP2RAGE sequence.