Issue with Mouse MRI Image Registration to Standard Brain Template

Dear Experts,

I hope you are doing well. I am reaching out regarding an issue we are encountering with the registration of mouse MRI images.
We are working with the following datasets:

  1. Structural MRI image (01_T2_1_refit_masked.nii)
  2. Functional MRI image (01_BOLD_volreg_despike.nii)
  3. Mouse brain template (Mouse_template_RAI.nii)

We have successfully used AFNI to check the alignment of all three datasets, and the directions appear to be consistent.

We were able to register the structural MRI images to the functional MRI images and obtain 01_T2_1_refit_masked_2epi.nii. This was done using the following command:
3dAllineate -master 01_BOLD_volreg_despike.nii.

However, I would prefer to use the structural image (01_T2_1_refit_masked.nii) as the master image, but for some reason, when I attempt this, the resulting image appears incomplete or missing parts. I'm not sure why this is happening.

The most important question is: we can not register the registered structural images (01_T2_1_refit_masked_2epi.nii) to the standard brain template(Mouse_template_RAI.nii). We attempted to perform the registration by first resampling the brain template with 3dresample, but the registration still fails, and the results are not satisfactory.

Could you kindly provide any insights or suggestions on how we might resolve this issue? Any advice on improving the alignment of the registered structural images with the standard brain template would be greatly appreciated.

Thank you for your time and assistance.

Hi-

What kind of alignment would you like to do between the structural dataset and the mouse template---linear affine, or nonlinear?

Also, it looks like your structural dataset is T2-weighted (I am guessing just from the name). Is your mouse template also T2-weighted? (maybe you could show a single slice image of each of your datasets here.) Most template datasets that I am familiar with are T1-weighted, which would have differing tissue contrast, and so that will affect the choice of cost function during alignment. This and other alignment considerations are discussed in this AFNI Academy playlist on alignment.

Stepping back, are you hoping to process FMRI data and have it all end up in template space? This would best be accomplished using, perhaps running @animal_warper prior to that to estimate nonlinear alignment to between the anatomical and template. An overview, with examples, of using afni_proc.py is here:

  • Reynolds RC, Glen DR, Chen G, Saad ZS, Cox RW, Taylor PA (2024). Processing, evaluating and understanding FMRI data with afni_proc.py. Imaging Neuroscience 2:1-52.
    https://doi.org/10.1162/imag_a_00347

... and then a description of @animal_warper is provided here:

--pt

This took a little while. The data has a number of unusual properties.

  1. First, while the data is consistent among all the input types (not including any potential left-right flipping), it does not have the correct orientation. This often happens with animal studies where the orientation of the animal's head is in a sphinx position, and the scanner's orientation are defined relative to typical human orientation planes. We can fix this by "desphinxifying" the data, redefining the orientation. That way the axial, coronal and sagittal images look like they belong to those planes.
  2. The data is very anisotropic. While this is fine for some clinical and histological analysis, it often doesn't work well with many of the things we do regarding alignment, like motion correction, alignment between datasets - epi to anat, anat to a template. With some of this (template at 10x10x200micron), the anisotropy is a factor of 20 times larger in a slice than the voxel resolution within the slice. That means all alignment even just slightly out of the plane of slice acquisition loses much of the resolution. Consider acquisitions that are more isotropic if that can meet your research goals. If you need the high in-plane resolution, a matched set of isotropic and anisotropic might be useful for computing transformations.
  3. The data has lots of empty space. That's not useful because it complicates alignment and uses up lots of memory and slows down all the computations. The program 3dAutobox can reduce the grid to only areas within a much smaller mask.
  4. @animal_warper can be used for alignment of the T2 dataset to a template. With some experimentation, I found the method below.
  5. Consider other mouse templates like the Allen mouse template and atlas. I have a version with a coordinate system and anisotropic voxels - link below.
# desphinxify (fix orientation) for template
desphinxify -input Mouse_template_RAI.nii \
    -prefix Mouse_template_desphinx_rsp.nii.gz \
    -workdir temp_desphx_rsp -orient_mid RSP
# desphinxify (fix orientation) for T2
desphinxify -input 01_T2_1_refit_masked.nii \
    -prefix T2_desphx -workdir temp_T2_desphx_rsp -orient_mid RSP

# autobox data to make smaller
# downsample / resample to limiting T2 resolution 
# and make isotropic 0.1mm

# align T2 to template
# use -align_type affine for testing to make this faster
# 1.0 mm is the feature_size used found through trial and error,
# larger than expected for mouse,possibly because of large anisotropy
# lpa cost function is used, some tissue contrast is similar,
@animal_warper -base Mouse_template_desphinx_rsp.nii.gz  \
  -input T2_rs_shft.nii.gz -feature_size 1 -dset_abbrevs T2  \
  -outdir aw_test -base_abbrev template -cost lpa -ok_to_exist

template to T2 alignment (template shown as red edge overlay) - affine only

https://discuss.afni.nimh.nih.gov/t/how-to-rotate-mouse-brain-mri-for-quick-afni-registration/6403/9