[Insight-users] Re: Cartesian to polar filter in ITK
Jakub Bican
jakub.bican at matfyz.cz
Mon Jan 22 10:43:51 EST 2007
Hi.
I checked the code and the paper and i found some typos in the paper.
The code was good. You can compute the angle as acos(x/r), same as
atan(y/x) (better atan2(y,x)). These options are mathematically
equivalent. I modulate negative angle values, so that the angle is
always in [0,360]
I had typo in the paper so that there was acos(x/y) instead of
acos(x/r), but in the code it was correct.
By definition, polar transform is located in the center of cartesian
coordinate system. In the ITK transform layout, geometrical transforms
do not know anything about images so it is not possible to determine
the center of the image. The solution is (as you wrote) to set the
origin to -1*Size*Spacing*0.5 in each dimension. In this way, you can
also set the center to any aother point of the image. I am sure that
this will not crash as i am using the same code in my experiments...
Regards,
Jakub
2007/1/22, Ali - <saveez at hotmail.com>:
>
> Jakub,
> Thanks. The transform classes you provide are useful, just a couple of
> issues:
> - Why did you use theta = acos(y/x) and not theta = atan(y/x)?
> - The polar transform is not located at the centre. In order to do so the
> origin
> must be set to (-xSize/2, - ySize/2) where (xSize, ySize) is the size of the
> output image. Setting the origin to any negative value causes a crash with
> the provided polar transform.
>
>
> The contribution referenced by Moti will help you to transform image between
> cartesian and polar (generally multidimensional cylindrical) coordinates.
> You need to use these transforms with ResampleImageFilter to compute the
> transformation (see ITK Software Guide section 6.9.4 Resample Image Filter).
> Note, that to transform image from cartesian to polar coordinates, you need
> to use PolarToCartesianTransform, because ITK is using transforms to map
> points from output space to input space. If you have any problems or
> questions, feel free to ask me.
>
> Unfortunately, these transforms do only polar mapping. If you need to make
> log-polar mapping, i can assist you to write your own transform.
>
> Jakub
>
> ________________________________
> Be one of the first to try Windows Live Mail.
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
More information about the Insight-users
mailing list