AFNI's 3dcalc, which seems to be similar to FSL's avwmaths program,
includes the arctangent via the atan and atan2 parameters in the
expression.
3dcalc -a dset.nii -prefix atandset.nii -datum float -expr 'atan
(a)'
where the result is in radians.
For the result in degrees instead,
3dcalc -a dset.nii -prefix atandset.nii -datum float -expr
'180 / PI * atan(a)'
Daniel Glen
On Jul 16, 2007, at 6:09 PM, Christian Beckmann wrote:
> Hi,
>
> in case you don't want to code you can always try calculating the
> angle via the series expansion of the arctan(x) for |x| < 1...
> just a though...
> christian
>
>
> On 16 Jul 2007, at 19:34, Saad Jbabdi wrote:
>
>> In that case, I don't know!
>>
>> make_dyadic_vectors is useful to extract the mean fibre
>> orientation from bedpost samples. As it calculates sines and
>> cosines for you, I thought it might be a good hack for extracting
>> sines and cosines from images! But if you need arctan, then I
>> don't know any fsl tool that does calculate that. You will need to
>> code it yourself! (note that it is not difficult to add
>> functionalities to avwmaths).
>>
>> cheers,
>> saad
>>
>>
>> On 16 Jul 2007, at 19:19, Jason Steffener wrote:
>>
>>> Dear Saad,
>>> Hello. Thank you for the feedback.
>>> I am actually looking for the arctan to calculate the angles.
>>> And what is make_dyadic_vectors used for? And how can I find out
>>> more about how this function works?
>>>
>>> Thank you,
>>> Jason.
>>>
>>>
>>> ----- Original Message ----
>>> From: Saad Jbabdi <[log in to unmask]>
>>> To: [log in to unmask]
>>> Sent: Monday, July 16, 2007 1:38:17 PM
>>> Subject: Re: [FSL] Arc Tangent of images
>>>
>>> Hi Jason -
>>>
>>> Calculating the tangent of an angle (in radian) using fsl tools
>>> is straightforward if you take advantage of make_dyadic_vectors.
>>> all you need to do is provide two images:
>>>
>>> make_dyadic_vectors image1 image2 output
>>> where image2 is all zeros and image1 are your angles x.
>>>
>>> then the ouput is a 4D image where the 4th dimension has the
>>> following entrie: [sin(x)cos(0); sin(x)sin(0); cos(x)]
>>>
>>> then you divide the 1st by the last entry to get the tangent!
>>>
>>> for the arctangent, it is a little bit trickier... but i'm not
>>> sure which one you really want given your email?
>>>
>>>
>>> i hope this is helpful...
>>> saad
>>>
>>>
>>> On 16 Jul 2007, at 16:12, Jason Steffener wrote:
>>>
>>>> Hello all,
>>>>
>>>> Is there any way of taking the arc tan (or sine/cosine) of two
>>>> images in FSL? I can easily do it in MatLab but am trying to set
>>>> up a "pure" FSL analysis.
>>>>
>>>> Thank you,
>>>> Jason.
>>>
>>> --------------------------------------------------------------------
>>> -------
>>> Saad Jbabdi,
>>> Postdoctoral Research Assistant,
>>> Oxford University FMRIB Centre
>>>
>>> FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
>>> +44 (0) 1865 222545 (fax 222717)
>>> [log in to unmask] http://www.fmrib.ox.ac.uk/~saad
>>> --------------------------------------------------------------------
>>> -------
>>>
>>>
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> ------
>> Saad Jbabdi,
>> Postdoctoral Research Assistant,
>> Oxford University FMRIB Centre
>>
>> FMRIB, JR Hospital, Headington, Oxford OX3 9DU, UK
>> +44 (0) 1865 222545 (fax 222717)
>> [log in to unmask] http://www.fmrib.ox.ac.uk/~saad
>> ---------------------------------------------------------------------
>> ------
>>
>>
>>
>>
>
> ____
> Christian F. Beckmann
> University Research Lecturer
> Oxford University Centre for Functional MRI of the Brain (FMRIB)
> John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK.
> [log in to unmask] http://www.fmrib.ox.ac.uk/~beckmann
> tel: +44 1865 222551 fax: +44 1865 222717
|