Applying transformation to a volume+matrix format+reorientation algorithm

181 views
Skip to first unread message

Jose Barona

unread,
Oct 1, 2012, 5:26:30 PM10/1/12
to dt...@googlegroups.com

  Hi!

 Is there a way to apply a transformation matrix to a volume without actually registering the volume to another? I tried with dti_affine_reg but I guess this command expects a target volume. I only want to apply an averaged transformation to a volume.

 Also, I realized the matrix returned by dti_affine_reg is not a 4x4 matrix like in FSL. Instead it gives a 3x3 matrix plus a vector. Can somebody explain to me why this format is different?

Finally, I am not sure but I think the algorithm used by DTI-TK to reorient the tensors after a transformation is Finite Strain. Is there a way to use PPD instead?

Thanks and I'm sorry if some of these questions are really basic, I'm still getting the hang of the whole DTI thing!

 

Hui Zhang

unread,
Oct 2, 2012, 6:59:37 AM10/2/12
to dt...@googlegroups.com
Hi Jose,

Is there a way to apply a transformation matrix to a volume without actually registering the volume to another? I tried with dti_affine_reg but I guess this command expects a target volume. I only want to apply an averaged transformation to a volume.

The short answer is yes.  There are two separate tasks concerned here: one is the matter of alignment, i.e., finding a transformation that you need to align one image to another; second is the matter of warping, i.e., creating a new image from an existing one given a desirable transformation.  "dti_affine_reg" does both in one go, as this is normally the use case scenario.  To do just the warping, you need to have a look at the following tutorial:


As you will see that, there are a rich set of options available to you.


 Also, I realized the matrix returned by dti_affine_reg is not a 4x4 matrix like in FSL. Instead it gives a 3x3 matrix plus a vector. Can somebody explain to me why this format is different?

The affine transformation can be represented in two equivalent ways: one is the 4x4 matrix, as in FSL; the other is the 3x3 matrix plus a vector, as in DTI-TK.
 
Finally, I am not sure but I think the algorithm used by DTI-TK to reorient the tensors after a transformation is Finite Strain. Is there a way to use PPD instead?

DTI-TK uses PPD by default for warping but uses FS for aligning.  I'm curious why you thought that FS is used for warping instead.
 
Thanks and I'm sorry if some of these questions are really basic, I'm still getting the hang of the whole DTI thing!

No worries.  Hope this is helpful.

Gary
 

Jose Barona

unread,
Oct 2, 2012, 1:44:05 PM10/2/12
to dt...@googlegroups.com

 Hi Gary,

 Thanks you so much for your help!

 In answer to your question, I though the algorithm used FS because I wasn't looking carefully at the output! I noticed when running the command part of the output  said "Reorient Option : FS". Only now I noticed there is another "Reorient Option: PPD" a few lines below.

Also, regarding the matrix, I was wondering if there is a straightforward way to go from one format to the other(3x3 + vector to 4x4 and back). This is because I am trying to average some of these matrices before applying them to the subjects. I suppose I could try to convert them manually but if there's an easier way that wold be neat!

 Thanks again!

Hui Zhang

unread,
Oct 2, 2012, 2:26:17 PM10/2/12
to dt...@googlegroups.com
 In answer to your question, I though the algorithm used FS because I wasn't looking carefully at the output! I noticed when running the command part of the output  said "Reorient Option : FS". Only now I noticed there is another "Reorient Option: PPD" a few lines below.

I see. No problem.
 
Also, regarding the matrix, I was wondering if there is a straightforward way to go from one format to the other(3x3 + vector to 4x4 and back). This is because I am trying to average some of these matrices before applying them to the subjects. I suppose I could try to convert them manually but if there's an easier way that wold be neat!

 I just added the functionality to the CVS repository.  You will need to check out the repository and compile the code yourself.  The tool to use is called affine3Dtool, the exact command looks like this

affine3Dtool -in input.aff -out output.mat

affine3Dtool -in input.mat -out output.aff

Not sure if it is exactly the flirt matrix format, in mat file, you should find a 4x4 matrix.

Hope it helps.

Gary

Jose Barona

unread,
Oct 8, 2012, 11:55:39 AM10/8/12
to dt...@googlegroups.com

  Gary,

   affine3Dtool works perfectly to convert from DTI-TK .aff format to flirt formatted matrix and back. Thanks so much!

 Jose

Hui Zhang

unread,
Oct 8, 2012, 1:43:04 PM10/8/12
to dt...@googlegroups.com
Great! Thanks for verifying that.

Gary
Reply all
Reply to author
Forward
0 new messages