AFNI version info (afni -ver):
Precompiled binary macos_10.12_local: Dec 6 2024 (Version AFNI_24.3.08 'Elagabalus')
I am nonlinearly aligning a subject's T1 (source) to the NMT template (base). I am using 3dQwarp with -allineate. There is an unusual feature in the subject's T1 that (I think) messes up with the alignment.
So I'd like to exclude that feature.
I drew an exclusion mask on the subject's T1. But the mask should be in base volume coordinates... how do I deal with it? Should I warp NMT to the subject making the subject my base, save the linear & non-linear transform, and then invert them and apply to the subject T1?
Swapping the source input and base datasets seems reasonable. You can save the inverse warp with the -iwarp option. Another solution is simply to zero out the mask on input and apply the warp to the T1. The solutions will be different.
Just to be sure, for the second solution do you mean making the input (i.e. the subject T1) zero wherever the mask is non-zero? If yes, wouldn't it "attract" this region to dark areas of the template which are closer to 0 than brighter areas?
This probably also tells you that I don't know how emask works internally during the alignment. I imagined that conceptually it replaces the masked input with NaNs or something like that and the cost function is not computed over the masked region. And, for non-linear alignment, the warp over that non-existent region is extrapolated from the neighboring, existent regions. Is it any close to waht's happening?
Yes, that's what I meant. The exclusion mask works by adjusting the weighting of the costs to zero within the mask on the base dataset. 3dAllineate's help has a bit more description:
-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.
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.