Strategies for aligning NHP T2s to NMT

Hi all,

I am working on some difficult NHP T2s that I need to align to NMT. They are difficult because some are not exactly complete (the rear and sometimes the very front of the brain is cut off), they have an implant artifact, and crucially in the most important area they have both a local change of tissue shape and a hypersignal. (my ultimate goal is to threshold that hypersignal or it’s difference from normal brain, and refer it to the atlas)

If the T2s were acquired along with a T1 things would be easier (such T1 would have that local change of shape but no hypersignal, so it should warp nicely to NMT, and I could apply the warp to the T2), but most weren’t.

Can you offer any hints as to strategy? So far I have had most luck with 3dAllineate followed by 3dQWarp both on inverted T2s (via 3dUnifize -T2 -T2), both using either hel or lpa. Though none is as a good as I would like, and also if hel works on some cases it fails on others, and vice versa for lpa. I may have to accept that but I am still hoping for a more universal solution. Even the better cases are not perfect, the main problem (as far as I can tell) seems to be confusing the gm/csf boundary with either the wm/gm boundary or csf/skull boundary along the dorsal surface,

One area in which I have been failing completely is skull stripping. I am aligning non-stripped T2 to non-stripped NMT. I have a feeling that stripped T2 to stripped NMT would align better, but is there a good way to strip such T2 before alignment? I tried 3dAutomask and it basically thinks that almost the entire volume is brain. 3dSkullStrip creates a blob that more resembles the brain but still it deviates from the actual brain by a lot. Maybe I can’t figure out how to tune them to a monkey T2. Any suggestions, please?

Hi, Pawel-

Indeed, I would start with 3dAllineate—can always add nonlinear tweaks later, but also if this step fails badly, nonlinear wouldn’t start well.

Note that 3dAllineate and 3dQwarp both have this opt:

-emask ee   = This option lets you specify a mask of voxels to EXCLUDE from
               the analysis. The voxels where the dataset 'ee' is nonzero
               will not be included (i.e., their weights will be set to zero).
             * Like all the weight options, it applies in the base image
               coordinate system.
            ** Like all the weight options, it means nothing if you are using
               one of the 'apply' options.

So can you make a mask of the implant artifact to provide as an “exclusion mask,” so that doesn’t drive/distract alignment?

I would have started with lpc (or lpc+ZZ) between the subject T2w and NMT T1w reference; maybe with the emask that will have better traction?

I agree that starting with non-skullstripped to non-skullstripped might be best way to start (and then use that alignment to help remove skull—that is what @animal_warper does; actually, I could probably add an “-emask …” opt to @animal_warper, too). But if the skull is relatively bright in both datasets, while the internal tissue contrasts are opposite, then it might be worth adopting a different strategy. Would you mind sharing an image of one of your T2w volumes, either sagittal or coronal?


If you don’t mind, I would rather prefer to share them directly with you via email, or an entire volume via OneDrive or Box.Is that OK?

Totally fine.

Adding a little more to this -

  1. Cost function. Consider nmi in addition to the lpc and lpc+ZZ cost functions for differing tissue intensities like this.
  2. Manual masking. Masking the data by hand with a simple sphere might be a good initial mask particularly if you have lots of other material, neck, shoulders,…
  3. CT. If you happen to have a CT volume, you could compute a mask from that to remove all the gadgetry and align to the subject’s T2 MRI. Then use the CT mask on the T2 dataset.

Hi Daniel,

Thank you for the suggestions. Incidentally, earlier today I got a pretty good result with lpa on inverted T2 with some additional constraints. But I’ll give nmi on non-inverted a try as well.

I did pretty tight box-cropping. I can try a sphere too, but my concern is that some of the scans were acquired with in front of the frontal poles and the occipital lobe was even partially left out in some. So a spherical mask will remove some tissues external to the brain but also some brain tissue. Still alignment might work better.

I think I only have CT of one of these monkeys, but I will try this approach at least in him!

Thanks again,


I have had good results using @animal_warper with cost lpc on T2w scans of NHP with implants. No crazy hyperintensities though, but I suppose the masking approach might help you out there…

Thank you, I think I did @aw a shot early, it did not work out of the box, and I did not pursue. I might revisit. So far of Daniel’s ideas I tried nmi but it did not go well with my data