[ITK] [ITK-users] Polar2Cartesian Behavior
Somesh
someshsandbox at gmail.com
Sun Sep 11 21:19:41 EDT 2016
Thanks Matt. In step 3, I generate a polar image and in Step 4 I want to
get the corresponding cartesian image. Since in Step 3, the maximum radius
of my polar image is R=20 , so I have the cartesian image range from -R to
R for both X and Y and I set the default pixel to 0. The pixels in the
polar image have value equal to R. So I expected a circular image similar
to step 1. However I get a distorted/cropped semi-circle.
The use case of this program is the following. I have a cylindrical image.
I have to re-sample it at finer intervals in theta. Then I want to convert
it to cartesian co-ordinates. Given a polar to cartesian transform,
shouldn't the resample image filter be able to handle this ?
Regarding the CurvilinearArraySpecialCoordinatesImage class. How can I use
it to convert a cylindrical image to Cartesian image ? Since it is an
"Image" class and not a "Transform" class, I am a little unclear on how to
use it. Should I manually create the desired cartesian grid, find the
co--responding polar co-ordinate using
CurvilinearArraySpecialCoordinatesImage APIs and fill in the pixels. Also
do have have to manually handle the interpolation ? Or can I still use the
ResampleImageFileter to do these steps ?
Thanks,
Somesh
On Sun, Sep 11, 2016 at 1:37 PM, Matt McCormick <matt.mccormick at kitware.com>
wrote:
> Hi Somesh,
>
> One issue: the domain of the Polar image (Step 3) needs to be larger
> if it is going to be sampled in the domain requested in Step 4. If
> Step 4, the radius goes up to sqrt(20^2 + 20^2) instead of 20.
>
> In general, a SpecialCoordinatesImage like
> itkAzimuthElevationToCartesionTransform works better than using a
> Transform in ITK. This is implemented here:
>
> https://github.com/KitwareMedical/ITKUltrasound/blob/master/include/
> itkCurvilinearArraySpecialCoordinatesImage.h
>
> HTH,
> Matt
>
> On Sat, Sep 10, 2016 at 12:11 PM, Somesh <someshsandbox at gmail.com> wrote:
> > Hi,
> > I have a very simple polar to cartesian filter. Its similar to
> > itkAzimuthElevationToCartesianTransform. The source code can be found @
> > https://github.com/someshSandbox/Polar2Cartesian
> >
> > I generate cartesian and polar images and use the resample filter to do
> the
> > conversion for testing. While the conversion from Cartesian to Polar
> works,
> > Polar to conversion doesn't. The sample images can be found at the
> following
> > links:
> >
> > Created Cartesian Image: origin(-20, -20) size(40,40), spacing(1, 1)
> > https://github.com/someshSandbox/Polar2Cartesian/
> blob/master/images/Cartesian.png
> >
> > Used filter to convert Cartesian Image to Polar: origin(0, 0)
> size(20,360),
> > spacing(1, 1). This works.
> > https://github.com/someshSandbox/Polar2Cartesian/blob/master/images/
> Cartesian2Polar.png
> >
> > Created Polar Image: origin(0, 0) size(20,360), spacing(1, 1)
> > https://github.com/someshSandbox/Polar2Cartesian/
> blob/master/images/Polar.png
> >
> > User filter to convert Polar Image to cartesian: origin(-20, -20)
> > size(40,40), spacing(1,1). This doesn't work.
> > https://github.com/someshSandbox/Polar2Cartesian/blob/master/images/
> Polar2Cartesian.png
> >
> > I am probably missing something trivial, but can't seem to locate the
> bug. I
> > would appreciate if someone can review the code.
> >
> > Thanks,
> > Somesh
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/insight-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160911/0acd356c/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list