Hi,
I use 3dAllineate with ‘-warp shift_rotate’ to align two datasets and the output matrix contains 12 parameters. How can I convert the parameters in the matrix to extract the Euler angles?
Thanks,
phoebe
Hi,
I use 3dAllineate with ‘-warp shift_rotate’ to align two datasets and the output matrix contains 12 parameters. How can I convert the parameters in the matrix to extract the Euler angles?
Thanks,
phoebe
Hi Phoebe,
The afni_util.py utility should be able to get those.
Perhaps you can first store the 12 numbers in a
shell variable using 1dcat to strip the header. Then
pass that to afni_util.py -listfunc, as in:
set mat = ( `1dcat $matfile | head -n 1` )
afni_util.py -listfunc -join -float affine_to_params_6 $mat
How does that seem? Those could be put together
into one command, of course.
Hi Rick,
Thanks for your reply. The following error prompts when I run afni_util.py with all 12 values from affine matrix in $mat:
afni_util.py -listfunc -join -float affine_to_params_6 $mat
Traceback (most recent call last):
File “/autofs/space/guasha_001/users/phoebe/bin/afni/current/afni_util.py”, line 3586, in
sys.exit(main())
File “/autofs/space/guasha_001/users/phoebe/bin/afni/current/afni_util.py”, line 3580, in main
return process_listfunc(argv)
File “/autofs/space/guasha_001/users/phoebe/bin/afni/current/afni_util.py”, line 3531, in process_listfunc
func = eval(argv[argbase])
File “”, line 1, in
NameError: name ‘affine_to_params_6’ is not defined
Any suggestions?
Phoebe
Maybe you don’t have that function, it was added
in February. What does “afni -ver” show?
Hi Rick,
I just update the AFNI. When I type afni_util.py, the following error appears.
[guasha:~] afni -ver
Precompiled binary linux_xorg7_64: Jul 25 2016 (Version AFNI_16.2.06)
[guasha:~] afni_util.py
afni_util.py: not intended as a main program
Thanks,
Phoebe.
That is okay. It was indeed not intended as a main
program. However it has the above mentioned back
door to its functions. Try the full “afni_util.py -help”
for more details. Note that it will still not mention
that function. Just try the commands as before.
Hi Rick,
It works now. Thanks so much.
One last thing to confirm with you. Is the convention of the Euler angles in:
(z-x-z, x-y-x, y-z-y, z-y-z, x-z-x, y-x-y)
THanks,
phoebe
Hi Phoebe,
Sorry, but I didn’t actually comprehend that you
wanted something other than the main parameter
angles that a typical factorization would generate.
Paul Taylor set me straight. Bringing up the z-x-z
and related order conventions clarified it.
So then to back up, I believe that we do NOT have
a tool to generate the formal Euler angles. The
afni_util.py angles should basically match the
parameters applied in 3dAllineate, but not the
rotating frames of reference.
What do you actually need the Euler angles for?
Maybe that is something that could be added.
Hi Rick,
I would like to see how different bony landmarks on the skull aligned with the radiographic baseline. I have one T1-template which has the radiographic baseline aligned horizontal. It is treated as a reference. For example, if I want to know how the supra-orbital floor is oriented with the radiographic baseline, I will align the supra-orbital floor to horizontal in another dataset. Then use the 3dAllineate to align the horizontal supra-orbital floor with horizontal radiographic baseline. As we would like to translate all the outputs in Euler angles, do you think it’s possible to add this function in afni_util.py or directly in 3dAllineate?
Thanks,
Phoebe.
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.
Freedom of Information Act |
HHS Vulnerability Disclosure
National Institute of Mental
Health | National Institutes of Health | U.S.
Department of Health and Human Services |