Combine multiple MRI partial acquisitions into a one file

I have an MRI dataset where for each subject, I have multiple acquisitions for each orientation:

Each images clearly shows the orientation it is named of but other orientations are squashed. I guess this is because the physicians want a faster way to allocate the tumor instead of taking a full resolution image. For instance, the file labeled with SAG looks like this:

Is there a software that would combine these files into one file that clearly shows all the three orientation?

1 Like

Dear @h_b,

It’s an anisotropic acquisition, so one option could be to first resample all orientations to isotropic with FSL flirt:

flirt -in AX_T1.nii.gz -ref AX_T1.nii.gz -out AX_iso.nii.gz -applyisoxfm 1
flirt -in COR_T1.nii.gz -ref COR_T1.nii.gz -out COR_iso.nii.gz -applyisoxfm 1
flirt -in SAG_T1.nii.gz -ref SAG_T1.nii.gz -out SAG_iso.nii.gz -applyisoxfm 1

Then you could merge these files in time
fslmerge -t merged.nii.gz AX_iso.nii.gz COR_iso.nii.gz SAG_iso.nii.gz

And then compute a mean:
fslmaths merged.nii.gz -Tmean final.nii.gz

If there is motion between the acquisitions you could add a quick realignment using mcflirt

An even more sophisticated option would be use a superresolution approach as implemented in volgenmodel ( CAIsr/volgenmodel-nipype: volgenmodel-nipype is the port of volgenmodel to nipype. It creates nonlinear models from a series of input MINC files. (

All these tools are available via and you can even acess it in the browser: NeurodeskPlay


WIth regards to visualization, anisotropic data like yours will not appear squashed if you stretch the voxels so they are rectangular rather than square. With MRIcron you can choose the preference “Reorient images while loading” to influence this. You may also want to try tools like MRIcroGL, FSLview or NiiVue that will stretch anisotropic images.

While @stebo85 provides a couple of approaches to attempt to combine these images, I wonder if differences in intensity homogeneity and nonlinear distortions. IN my experience, MDs prefer 2D slices because most clinical tools only show the images in plane. You may want to educate the physicians on the benefit of a single isotropic 3D acquisition that can be re-sliced on the console by the MRI technologists to each of the orthogonal views.

1 Like

Dear @stebo85
Thank you, that was helpful.
One problem is that the resulted AX_iso.nii.gz COR_iso.nii.gz SAG_iso.nii.gz has different dimensions, let us say (200, 200, 149),(200, 200, 149),(240, 239, 123) respectively. I am not sure how fslmerge will be able to combine them? I tried it and it gives me the following error:

WARNING:: Inconsistent orientations for individual images when attempting to merge.
          Merge will use voxel-based orientation which is probably incorrect - *PLEASE CHECK*!

Error in size-match along non-concatenated dimension for input file:

I tried to see if flirt has an option to resample according to a specific file dimension. For instance, I can resample all the orientation based on the AXIAL orientation file. However, I do not think such functionality is supported yet. Do you have an idea how to workaround this?

Hi @h_b ,

It might be better to use one of the standard images provided by FSL for the reference file (e.g. -ref $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz).

Or alternatively, select one of the images as the -ref and use it for all.

1 Like