Print

Print


Hi,

If you are not familiar with matrix maths then I don't really know why you need to do this.  There are several possible conventions that can be used for Euler angles, but you could just try multiplying the matrices together rather than trying to calculate an axis.  

Maybe if you explain what your objective is then we might be able to find an easier method.

All the best,
Mark



On 27 Jun 2014, at 23:35, Kaiming Yin <[log in to unmask]> wrote:

Dear Mark,

Yes this should be exactly what I need, thanks a lot. So further our discussion, can makerot give me a convenient way to generate this axis, from e.g. the two Euler angles theta and phi? I am not good at maths so don't quite understand how to change between these angles and matrices and the axis vectors. Sorry for the bothering but really thanks.

Kaiming 


On Fri, Jun 27, 2014 at 8:33 AM, Mark Jenkinson <[log in to unmask]> wrote:
Hi,

The --axis option exists for this purpose.

All the best,
Mark


On 24 Jun 2014, at 15:20, Kaiming Yin <[log in to unmask]> wrote:

Hi Mark,

That's really helpful. Now I see my rotations reasonable. Also, if I want to further a rotation around an axis of the rotated image, e.g. like a spin of the Earth who has an oblique axis of rotation, can makerot do this?

Great thanks,
Kaiming


On Mon, Jun 23, 2014 at 12:55 PM, Mark Jenkinson <[log in to unmask]> wrote:
Hi,

The tool convert_xfm is very fussy about the ordering of options in the command line, and so I think your commands are not quite correct.  You need to follow the exact ordering in the usage examples.  It cannot concatenate more than two matrices at a time either, so the first option will not work.

To concatenate three matrices (to be equivalent to step3 * step2 * step1) you would do:

convert_xfm -omat steps12.mat -concat step2.mat step1.mat
convert_xfm -omat steps123.mat -concat step3.mat steps12.mat

All the best,
Mark


On 20 Jun 2014, at 13:45, Kaiming Yin <[log in to unmask]> wrote:

Dear Niels,

I used the makerot to creat three steps rotation matrix: step1.mat, step2.mat, and step3.mat.

and then use the convert_xfm to concatenate them in two ways:

1) all together in one commandline:
   convert_xfm step1.mat -concat step2.mat  step3.mat -omat trial_1.mat

2) in two commadlines:
   convert_xfm step1.mat -concat step2.mat -omat trial_2.1.mat
   convert_xfm trial_2.1.mat -concat step3.mat -omat trial_2.2.mat

However, trial_1.mat and trial_2.2.mat looks differernt.

Any helps here?

Thanks,
Kaiming


On Fri, Jun 20, 2014 at 12:47 PM, Kaiming Yin <[log in to unmask]> wrote:
Dear Niels,

I also tried the Nudge gui, it is greatly convenient, but seems can not load the fslview and my teminal said :"sh: 1: /usr/local/bin/fslview: not found ". Can I do something here?

Thanks,
Kaiming


On Fri, Jun 20, 2014 at 11:39 AM, Kaiming Yin <[log in to unmask]> wrote:
Hi Niels,

thanks for the suggestion, I am trying to use the makerot to generate the rotation matrix, and the convert_xfm to concatenate the matrix together. However, I am not sure how is the rotation going. Because I am rotating using the Euler angles on ZXZ-axises. and angles can be like e.g. phi=30, theta=45, tau=0. Could makerot generate this matrix?

Thanks,
Kaiming


On Thu, Jun 19, 2014 at 3:07 PM, Niels Bergsland <[log in to unmask]> wrote:
The tool Nudge can also help you create the transformation matrix (it
will also call flirt).

On Thu, Jun 19, 2014 at 3:49 PM, paul mccarthy <[log in to unmask]> wrote:
> Hi Kaiming,
>
> The 'flirt' command allows you to specify an affine transformation matrix to
> apply to an image. So if you create an affine transformation with your
> desired rotations, and save it as a plain text file (e.g. 'rotate.mat'), you
> can apply it to an image (e.g. 'image.nii.gz') like so:
>
> flirt -in image.nii.gz -ref image.nii.gz -applyxfm -init affine.mat -out
> rotated.nii.gz
>
> Cheers,
>
> Paul
>
>
> On Thu, Jun 19, 2014 at 2:18 PM, Kaiming Yin <[log in to unmask]>
> wrote:
>>
>> Hi guys,
>>
>> can FSL help with a random rotation of the MR image? e.g. a rotation of 30
>> degree in X-axis, 90 in Y-axis, and 120 in Z-axis.
>>
>> Thanks in advance,
>> Kaiming
>
>



--
Niels Bergsland
Integration Director
Buffalo Neuroimaging Analysis Center
100 High St. Buffalo NY 14203
[log in to unmask]