Hi,
You can either pick an axis that represents these rotations all together
and adjust the angle appropriately - e.g. axis of (-30,2,2) but normalised
to unit length and an angle of sqrt(30^2+2^2+2^2). Alternatively, generate
three separate rotations and combine them using convert_xfm with
the -concat option.
In general, combining rotations is tricky as the order is important, but
it probably won't make too much difference for this example.
All the best,
Mark
On 3 May 2012, at 06:03, Koene Van Dijk wrote:
> thanks Mark, that's another cool tool.
>
> I ran the following but it's just short of what would be perfect:
> makerot -c 80,80,47 -a 1,0,0 --theta=-30 -o matrix.mat
>
> After applying that matrix using flirt it's doing almost what I want: namely the output image was rotated 30 degrees around the x-axis.
>
> Now I would like to fine-tune:
> rotate around x: -30 degrees (what I did)
> rotate around y: 2 degrees
> rotate around z: 2 degrees
>
> Is it easy to say how I can accomplish that in one transformation matrix?
>
> Thanks,
> Koene
>
> =========================
> Usage:
> makerot [options] --theta=angle
>
> Compulsory arguments (You MUST set one or more of):
> -t,--theta angle of rotation (in degrees)
>
> Optional arguments (You may optionally specify one or more of):
> -a,--axis <ax,ay,az> unnormalised axis vector (comma separated)
> --cov image filename used for centre of volume
> -c,--centre <cx,cy,cz> centre of rotation in mm (comma separated)
> -o,--out output filename for matrix
> -v,--verbose switch on diagnostic messages
> -h,--help display this message
> =========================
>
>
>
>
>
>
> On Thu, 3 May 2012 05:28:31 +1000, Mark Jenkinson <[log in to unmask]> wrote:
>
>> Yes - use "makerot" to generate a FLIRT transformation.
>>
>> All the best,
>> Mark
>>
>> On 3 May 2012, at 05:26, Koene Van Dijk wrote:
>>
>>> Hi there,
>>> I'd like to rotate an image just a little bit: e.g. just 30 degrees around the x-axis. Is there a nice fsl tool/command for that?
>>>
>>> I've been using fslswapdim for 90 or 180 degree swaps but this is different. I looked into using flirt, e.g.:
>>> flirt -in input.nii.gz -ref copy_of_input.nii.gz -out output.nii.gz -applyxfm -init matrix.mat
>>>
>>> ... but I don't know what to use as matrix.mat. I've read in old posts that rotation and translation (with a normal flirt output.mat when registering one image to another) are highly related and it seemed much to complex for what I want: just a rotation and no translation and the center of the image may remain what it is now: 80 80 47 (so my input image has these dimensions: 160 x 160 x 94).
>>>
>>> Thanks for any help,
>>> Koene Van Dijk
>>>
>
|