AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
October 12, 2004 11:20PM
Bob or other aficionado:

I'd much appreciate a mental straightening-out on the seemingly simple
topic of AFNI philosophy on rotations.

I'm trying to understand 3drotate and associated library functions, in particular the meaning of the rmat matrix that's calculated by 3drotate. There are several steps that appear backwards to me. Maybe they all cancel out in the end, but this would make much more sense if I understood the design intent.

Questions:

1. Left/Right Hand Coordinate systems?
--------------------------------------
In Vecmat.h the LOAD_ROTGEN_MAT function -- judging by the sign of the sin elements, this appears to implement rotation for LEFT hand coordinates. This surprises me given AFNI's "prefered" DICOM data ordering, and also 3drotate's help saying rotation defined by right-hand rule.

Am I reading this wrongly, or what's the rationale here?

2. Direction of rotation modifiers:
-----------------------------------
ihand from THD_handedness: (negate angles for left hand -- OK, as expected)

THD_axcode: Returns a *negative* value if command line arg specifies rotation around *positive* direction of an axis. (3drotate negates thetas if this result is negative). I think.

(a) Why negative for positive direction?

(b) Why is this relative to the data order anyway? Surely interpretation of angles would be relative to coordinate system (LH or RH) not relative to data order? (More below).

(c) rot_to_matrix() args again negate the thetas. Why?

3. And the resulting rmat means???
----------------------------------

I was hoping to understand that the resulting rmat means one of the following:

a) How to calculate where an input point rotates to in the output data. OR
b) How to calculate where an output point came from in the input data.

... but trying to follow what happens to rmat downstream is a little daunting.

From the preceding comments my tentative conclusion is that rmat means neither (a) nor (b)... it's perhaps a prescription for how to perform a shear, customized for the specific data order (ORIENT_SPECIFIC)?

Anyhow, any clarification of what I'm looking at would be mighty helpful!

Thanks,

Graham

Subject Author Posted

Q on 3drotate, vecmat.h and related code

Graham Wideman October 12, 2004 11:20PM