<div dir="ltr">Thanks Matt. This is very helpful.<div><br><div>I had modeled my transform class on itkAzimuthElevationToCartesianTransform which also inherited from Affine transform.</div><div>Should this class also override GetTransformCategory(). It doesn't look like its doing it now. <a href="https://itk.org/Doxygen/html/itkAzimuthElevationToCartesianTransform_8h_source.html">https://itk.org/Doxygen/html/itkAzimuthElevationToCartesianTransform_8h_source.html</a></div><div><br></div><div>Thanks,</div><div>Somesh</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 11, 2016 at 9:47 PM, Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Sep 11, 2016 at 9:19 PM, Somesh <<a href="mailto:someshsandbox@gmail.com">someshsandbox@gmail.com</a>> wrote:<br>
> Thanks Matt. In step 3, I generate a polar image and in Step 4 I want to get<br>
> the corresponding cartesian image. Since in Step 3, the maximum radius of my<br>
> polar image is R=20 , so I have the cartesian image range from -R to R for<br>
> both X and Y and I set the default pixel to 0. The pixels in the polar image<br>
> have value equal to R. So I expected a circular image similar to step 1.<br>
> However I get a distorted/cropped semi-circle.<br>
<br>
</span>It looks like your Transform is inheriting from itk::AffineTransform,<br>
although it is not an AffineTransform. AffineTransform is a linear<br>
transform, and the ResampleImageFilter takes advantage of that<br>
property to optimize its computation:<br>
<br>
  <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/6ee10575445aa1c878797db4febf7d775a38f1f3/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx#L242-L249" rel="noreferrer" target="_blank">https://github.com/<wbr>InsightSoftwareConsortium/ITK/<wbr>blob/<wbr>6ee10575445aa1c878797db4febf7d<wbr>775a38f1f3/Modules/Filtering/<wbr>ImageGrid/include/<wbr>itkResampleImageFilter.hxx#<wbr>L242-L249</a><br>
<br>
So, your class need to override ->GetTransformCategory() to return<br>
UnknownTransformCategory.<br>
<span class=""><br>
<br>
> The use case of this program is the following. I have a cylindrical image. I<br>
> have to re-sample it at finer intervals in theta. Then I want to convert it<br>
> to cartesian co-ordinates. Given a polar to cartesian transform, shouldn't<br>
> the resample image filter be able to handle this ?<br>
<br>
</span>Yes, but the SpecialCoordinatesImage allows you to keep your data in<br>
native form and it prevents abuse of "spacing", etc.<br>
<span class=""><br>
<br>
> Regarding the CurvilinearArraySpecialCoordin<wbr>atesImage class. How can I use<br>
> it to convert a cylindrical image to Cartesian image ? Since it is an<br>
> "Image" class and not a "Transform" class, I am a little unclear on how to<br>
> use it. Should I manually create the desired cartesian grid, find the<br>
> co--responding polar co-ordinate using<br>
> CurvilinearArraySpecialCoordin<wbr>atesImage APIs and fill in the pixels. Also do<br>
> have have to manually handle the interpolation ? Or can I still use the<br>
> ResampleImageFileter to do these steps ?<br>
<br>
</span>Yes, you can use ResampleImageFilter and this class to perform the<br>
desired operations. Here is an example:<br>
<br>
 <a href="https://github.com/KitwareMedical/ITKUltrasound/blob/0cb92288333a9779da57511f779d0bde5ca35275/test/itkCurvilinearArraySpecialCoordinatesImageTest.cxx#L96-L110" rel="noreferrer" target="_blank">https://github.com/<wbr>KitwareMedical/ITKUltrasound/<wbr>blob/<wbr>0cb92288333a9779da57511f779d0b<wbr>de5ca35275/test/<wbr>itkCurvilinearArraySpecialCoor<wbr>dinatesImageTest.cxx#L96-L110</a><br>
<br>
HTH,<br>
Matt<br>
</blockquote></div><br></div>