Daniel,
a couple of years ago we came up with those scripts to rotate DTI gradient vectors.
Now, I came accross them again, and extended them to use with 3dAllineate transformations.
Please have a look at it and tell me if this would be the equivalent transformation for use with 3dAllineate (i.e. is ALLINEATE_MATVEC_B2S_000000 the right matrix to use...).
I added in @rotatevectorsall
# if there are no attributes from 3dvolreg in header, try 3dAllineate rotations
set check = `wc tempmatvec.1D`
if ($check[1] == 0) then
echo "Looking for ALLINEATE attribute instead"
( cat_matvec "$dset"'::ALLINEATE_MATVEC_B2S_000000' > tempmatvec.1D ) > & /dev/null
endif
and with the already existing:
# replace the translation vector with 0s
1dcat tempmatvec.1D'[0..2]' '1D:3@0' > tempmatvec0.1D
This should be the complete rotation matrix needed.
Let me know what you think,
Wolfgang