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) =&nbsp; 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> &lt;<a href="mailto:wlorens1@nycap.rr.com">wlorens1@nycap.rr.com</a>&gt; 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 &lt;<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com
</a>&gt;<br>Date: Thursday, March 22, 2007 9:55 am<br>Subject: [Insight-users] Re: ResampleImageFilter<br>To: &quot;Ranjan, Sohan (GE, Research)&quot; &lt;<a href="mailto:sohan.ranjan@ge.com">sohan.ranjan@ge.com</a>&gt;<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>&gt; On 3/22/07, Ranjan, Sohan (GE, Research) &lt;<a href="mailto:sohan.ranjan@ge.com">
sohan.ranjan@ge.com</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;Sorry folks. I typed in some terms things wrong. Here is the<br>&gt; actually&gt; what I want to say:<br>&gt; &gt;<br>&gt; &gt; As I understand, the ResampleImageFilter makes call to the
<br>&gt; TransformPoint&gt; method at every point. Is it really needed?<br>&gt; Essentially, one needs to make<br>&gt; &gt; call<br>&gt; &gt; only once with input vector elements being the spacings. The<br>&gt; result would
<br>&gt; &gt; give<br>&gt; &gt; deformation at every point.<br>&gt; &gt;<br>&gt;<br>&gt; This is true for a very specific set of transforms, such as the<br>&gt; TranslationTransform, IdentityTransform, isn&#39;t it ? It isn&#39;t true for
<br>&gt; affine, rotation, kernel transforms etc..<br>&gt;<br>&gt; Based on this, even the interpolation may be speeded<br>&gt; &gt; up because, say for example in linear interpolation, the co-<br>&gt; efficients&gt; need to be
<br>&gt; &gt; computed only once.<br>&gt; &gt;<br>&gt;<br>&gt; This is true only for the Linear and NN interpolators, with the<br>&gt; additionalconstraint that you&#39;re using them with the<br>&gt; aforementioned set of transforms.
<br>&gt;<br>&gt; Unfortunately &quot;itk::Transform::TransformPoint&quot; cannot be inlined,<br>&gt; since its<br>&gt; a virtual function. So the speedup you&#39;re looking for is probably a<br>&gt; dynamic_cast to check for the right combination of
<br>&gt; transform/interpolator in<br>&gt; the ResampleFilter and dump the code in there...<br>&gt;<br>&gt; There will always be a clash between generic programming allowing<br>&gt; you to<br>&gt; plug your own transform/interpolator and a specialized optimized
<br>&gt; versions :)<br>&gt;<br>&gt; --<br>&gt; karthik<br>&gt;<br>&gt; Am I right? If so, Is it already implmented and I am out of<br>&gt; &gt; luck?<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Sohan<br>&gt; &gt;<br>&gt;<br></blockquote>
</div><br><br clear="all"><br>