Skip to content

Super resolution of MRI images

parent41 edited this page Apr 29, 2023 · 1 revision

Super-resolution of MRI images

This wiki shows how to increase the resolution of MRI images. For example, going from 2mm isotropic DTI metrics to 1mm isotropic DTI metrics.

This differs from more simple interpolation when using something like mincresample. From Coupe et al., 2012:

These [interpolation] techniques assume that the existing points in the LR [low-resolution] image may be represented using some kind of generic functions (e.g., nth order polynomials in case of B-splines) with some smoothness assumptions. However, such techniques estimate new points assuming that the existing ones (in the LR images) have the same value in the HR [high-resolution] images which is only valid within homogeneous regions. These methods do not take into account the fact that the actual LR voxel intensity does not corresponds to an ideal sampling but a non-ideal sampling where the voxel intensity represents the weighted average of the underlying HR voxels within the LR voxel. As a result, interpolated images are typically, blurred versions of its corresponding HR reference images.

Many different tools for this task are available (maybe better?) but here we use a tool from the ANTs toolbox. See this paper for details: https://doi.org/10.1016/j.media.2010.05.010

Requirements

  • Lower-resolution scalar images (e.g., 2mm iso FA and MD from DTI)
  • Higher-resolution MRI images in the same space as the lower resolution images (e.g., 1mm iso T1-weighted from the same subjects). IF not in the same space yet, use bestlinreg or ANTs linear registration
  • Brain mask in the same space

Example script

Super-resolution script (saved as superres.sh)

# Processing DWI images to get DTI metrics (e.g., FA and MD)

ID=$1
other=$2
t1=$3
mask=$4
out_dir=$5

echo $ID

tmpdir=$(mktemp -d)

# Denoise (smooths the images, this is a required step)
minc_anlm --clobber ${t1} ${tmpdir}/$(basename $t1 .mnc)_anlm.mnc
minc_anlm --clobber ${other} ${tmpdir}/$(basename $other .mnc)_anlm.mnc

# Resample mask (t1w res for t1w, other res for other)
mincresample -clobber -nearest_neighbour -like ${tmpdir}/$(basename $t1 .mnc)_anlm.mnc ${mask} ${tmpdir}/$(basename $mask .mnc)_rsl_t1.mnc
mincresample -clobber -nearest_neighbour -like ${tmpdir}/$(basename $other .mnc)_anlm.mnc ${mask} ${tmpdir}/$(basename $mask .mnc)_rsl_other.mnc

# Brain extraction
minccalc -clobber -expression 'A[0]*A[1]' ${tmpdir}/$(basename $t1 .mnc)_anlm.mnc ${tmpdir}/$(basename $mask .mnc)_rsl_t1.mnc ${tmpdir}/$(basename $t1 .mnc)_anlm_extracted.mnc
minccalc -clobber -expression 'A[0]*A[1]' ${tmpdir}/$(basename $other .mnc)_anlm.mnc ${tmpdir}/$(basename $mask .mnc)_rsl_other.mnc ${tmpdir}/$(basename $other .mnc)_anlm_extracted.mnc

# Super-resolution
NonLocalSuperResolution -i ${tmpdir}/$(basename $other .mnc)_anlm_extracted.mnc -k ${tmpdir}/$(basename $t1 .mnc)_anlm_extracted.mnc -s 2048x1024x512x256x128x64x32x6x8x2x1 -g 20.0 -t 1e10 -p 1 -r 3 -o ${out_dir}/$(basename $other .mnc)_anlm_extracted_superres1mm.mnc -d 3 -v

rm -rf ${tmpsdir}

Then run the script using your inputs. Example:

# ID, image to super-res, image of higher-res, brain mask, output directory
./superres.sh sub-1000011_ses-2 ./micro_t1wspace/DWI_native_res/sub-1000011_ses-2_NODDI_OD_RSL_T1.mnc ./mri_raw/T1w_ses2/sub-1000011_ses-2_T1w.nii.gz ./t1w_preprocessed/sub-1000011_ses-2_T1w.nii.gz_itN3.mask.mnc superres
Clone this wiki locally