Yes as Bill mentioned, the transformation is computed just once per scan line for linear transforms, taking advantage of the fact that <br><br>T(P) = T(P_scanLineOrigin + n*Offset_delta_vector) = T(P_scanLineOrigin) + n*T(Offset_delta_vector).
<br><br>T(P_scanLineOrigin) and T(Offset_delta_vector) are precomputed for each scan line. <br><br>Thanks<br>--<br>karthik<br><br><div><span class="gmail_quote">On 3/22/07, <b class="gmail_sendername"><a href="mailto:wlorens1@nycap.rr.com">
wlorens1@nycap.rr.com</a></b> <<a href="mailto:wlorens1@nycap.rr.com">wlorens1@nycap.rr.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There is a fast path for linear tranformations, implemented in<br>LinearThreadedGenerateData<br><br>Bill<br><br>----- Original Message -----<br>From: Karthik Krishnan <<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com
</a>><br>Date: Thursday, March 22, 2007 9:55 am<br>Subject: [Insight-users] Re: ResampleImageFilter<br>To: "Ranjan, Sohan (GE, Research)" <<a href="mailto:sohan.ranjan@ge.com">sohan.ranjan@ge.com</a>><br>
Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a>, <a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a><br><br>> On 3/22/07, Ranjan, Sohan (GE, Research) <<a href="mailto:sohan.ranjan@ge.com">
sohan.ranjan@ge.com</a>> wrote:<br>> ><br>> > Sorry folks. I typed in some terms things wrong. Here is the<br>> actually> what I want to say:<br>> ><br>> > As I understand, the ResampleImageFilter makes call to the
<br>> TransformPoint> method at every point. Is it really needed?<br>> Essentially, one needs to make<br>> > call<br>> > only once with input vector elements being the spacings. The<br>> result would
<br>> > give<br>> > deformation at every point.<br>> ><br>><br>> This is true for a very specific set of transforms, such as the<br>> TranslationTransform, IdentityTransform, isn't it ? It isn't true for
<br>> affine, rotation, kernel transforms etc..<br>><br>> Based on this, even the interpolation may be speeded<br>> > up because, say for example in linear interpolation, the co-<br>> efficients> need to be
<br>> > computed only once.<br>> ><br>><br>> This is true only for the Linear and NN interpolators, with the<br>> additionalconstraint that you're using them with the<br>> aforementioned set of transforms.
<br>><br>> Unfortunately "itk::Transform::TransformPoint" cannot be inlined,<br>> since its<br>> a virtual function. So the speedup you're looking for is probably a<br>> dynamic_cast to check for the right combination of
<br>> transform/interpolator in<br>> the ResampleFilter and dump the code in there...<br>><br>> There will always be a clash between generic programming allowing<br>> you to<br>> plug your own transform/interpolator and a specialized optimized
<br>> versions :)<br>><br>> --<br>> karthik<br>><br>> Am I right? If so, Is it already implmented and I am out of<br>> > luck?<br>> ><br>> ><br>> > Sohan<br>> ><br>><br></blockquote>
</div><br><br clear="all"><br>