as usual I feel dumb asking these questions because it feels as if I am missing something trivial… but I cannot figure it out myself.
I am using align_epi_anat.py to align an anatomical T2 to an earlier anatomical T1 in the same NHP. The overall goal is to align that T2 to NMT, but I wasn’t able to do it directly. So I am using @animal_warper to align the T1 to NHP, and align_epi_anat.py to align T2 to T1, and the plan is to catenate the transforms.
It seems to be working fine, I may have to add a non-linear step after align_epi_anat.py because the brain has changed in some crucial areas, but that’s in the future.
At this point I wanted to ask - why my T2 is being cropped by align_epi_anat.py and how can I avoid/control this?
In the image, the top row is the result of align_epi_anat.py, showing aligned T2 in greyscale as OL, the T1 is UL in color The bottom row is the T2 (as greyscale UL) as submitted to alignment. Why is the bottom and especially the front cut off? I placed the cursor on the same feature and the image ends there in the result but there are a couple more anterior slices in the source file.
Can I somehow save that front? I know there is not much there, but still it’s a part I am interested in.
The grid of the output in align_epi_anat.py is controlled by the -master_xxx options. If you are using giant_move or ginormous_move, the grid is set to be on the base’s grid but with the isotropic resolution of the minimum dimension of the input dataset by default. The master options override any of the defaults, and you get the grid on the output you want. I think in this case, the dataset moved forward a bit with the alignment but stayed in the same grid location (no giant_move), and that removed the anterior portion. If you use the other dataset as the master, then you would get the full coverage at the cost of empty voxels. If you know that the aligned dataset only needs a few extra slices, you can make one with 3dZeropad, and that can be your target grid. You may also apply the affine transformation with 3dWarp, which moves the dataset and automatically computes the grid that fits if no gridset option is used.
thank you, adding:
to align_epi_anat.py options solved the issue,
Just to see how it works I tried to go through 3dWarp too, but with no -gridset applied it cropped the T2 in the same way as in my original post.
However, providing the T1 as the gridset produced a virtually identical result to align_epi_anat.py with -master_epi BASE (minute differences I guess due to different interpolation method). So I could go either way though -master_epi BASE is obviously more convenient, no additional step as opposed to two additional steps (3dWarp precede by onverting the transform from 12x1 to 3x4 format).
Thanks again, and I apologize that - as I just noticed - I did not include my full align_epi_anat.py call in the first post. I intended to!
Good to hear you have solved this. I am surprised the 3dWarp command didn’t give the full grid on the output without the -gridset option.