@animal_warper nmt macaque to F99

Hello AFNI experts

I would like to use a macaque atlas that is in the F99 template space.
In order to do that, I would like to send the atlas in the nmt template.

To do so I used:

@animal_warper -input nmt_1.2/NMT_SS.nii.gz -base Human_macaque_equivalent/F99_with_skull.nii.gz -atlas RM_inF99.nii.gz -outdir Human_macaque_equivalent/InD99 -skullstrip Human_macaque_equivalent/F99_with_skull_mask.nii.gz

The problem is that the registration fails especially in the prefrontal area.
I can see that two templates overlap but the F99 remains larger in the prefrontal area.

I tried with -cost lpc and nmi and with -supersize with no improvement.

Thank you in advance for your help!
By the way thank you also for the update of @animal_warper!!!


Salut, Clément-

Would you mind uploading the relevant dsets, and I’ll take a look? (Note: I would need both the base F99* dset and the accompanying atlas, as well as brain mask.)


Salut pt,
No problem I will send you that straight away.

Hi, Clément-

Thanks for sending the data.

I don’t think your alignment case calls for @animal_warper; you have basically 2 skullstripped dsets to align, after doing this:

# apply mask to F99
3dcalc \
   -a F99_with_skull_mask.nii.gz \
   -b F99_with_skull.nii.gz \
   -expr 'a*b*step(b)' \
   -prefix F99_SS.nii.gz \

so my thought would be to just use 3dQwarp directly, and apply the warp to the F99-atlas you have. So, I am running this command now (note use of lpa cost function, because the NMT and F99 have similar contrasts; I chose to run it just to level 9, which I expect to be fine):

# align F99 -> NMT
3dQwarp \
    -allineate \
    -lpa \
    -maxlev 9 \
    -source F99_SS.nii.gz \
    -base NMT_SS.nii.gz \
    -prefix F99_in_NMT.nii.gz \
    -inedge \
    -allineate_opts "-autoweight -source_automask"

When that finishes running, you can warp your atlas, which is in F99 space, to NMT space with:

# also use "-master .." so the new dset is on the NMT grid
3dNwarpApply   \
    -nwarp "F99_in_NMT_WARP.nii.gz" \
    -master NMT_SS.nii.gz  \
    -source RM_inF99_sp.nii.gz    \
    -prefix RM_inNMT.nii.gz   \
    -interp NN

Note that if the NL warp had been estimated with @SSwarper, I would have to provide both the WARP + *.aff12.1D matrix to be concatenated after “-nwarp …”; but 3dQwarp on its own puts the full NL warp (which already includes the affine part) into the WARP set— the aff12.1D file is just for the first step alone.

… and the final alignment looks good-- attached is an image of the F99 warped in NMT space, overlaying the (edgified) NMT template.