[Insight-users] Re: ResampleImageFilter

Karthik Krishnan karthik.krishnan at kitware.com
Thu Mar 22 13:25:58 EST 2007


Yes as Bill mentioned, the transformation is computed just once per scan
line for linear transforms, taking advantage of the fact that

T(P) =  T(P_scanLineOrigin + n*Offset_delta_vector) = T(P_scanLineOrigin) +
n*T(Offset_delta_vector).

T(P_scanLineOrigin) and T(Offset_delta_vector) are precomputed for each scan
line.

Thanks
--
karthik

On 3/22/07, wlorens1 at nycap.rr.com <wlorens1 at nycap.rr.com> wrote:
>
> There is a fast path for linear tranformations, implemented in
> LinearThreadedGenerateData
>
> Bill
>
> ----- Original Message -----
> From: Karthik Krishnan <karthik.krishnan at kitware.com>
> Date: Thursday, March 22, 2007 9:55 am
> Subject: [Insight-users] Re: ResampleImageFilter
> To: "Ranjan, Sohan (GE, Research)" <sohan.ranjan at ge.com>
> Cc: insight-users at itk.org, luis.ibanez at kitware.com
>
> > On 3/22/07, Ranjan, Sohan (GE, Research) <sohan.ranjan at ge.com> wrote:
> > >
> > >  Sorry folks. I typed in some terms things wrong. Here is the
> > actually> what I want to say:
> > >
> > > As I understand, the ResampleImageFilter makes call to the
> > TransformPoint> method at every point. Is it really needed?
> > Essentially, one needs to make
> > > call
> > > only once with input vector elements being the spacings. The
> > result would
> > > give
> > > deformation at every point.
> > >
> >
> > This is true for a very specific set of transforms, such as the
> > TranslationTransform, IdentityTransform, isn't it ? It isn't true for
> > affine, rotation, kernel transforms etc..
> >
> > Based on this, even the interpolation may be speeded
> > > up because, say for example in linear interpolation, the co-
> > efficients> need to be
> > > computed only once.
> > >
> >
> > This is true only for the Linear and NN interpolators, with the
> > additionalconstraint that you're using them with the
> > aforementioned set of transforms.
> >
> > Unfortunately "itk::Transform::TransformPoint" cannot be inlined,
> > since its
> > a virtual function. So the speedup you're looking for is probably a
> > dynamic_cast to check for the right combination of
> > transform/interpolator in
> > the ResampleFilter and dump the code in there...
> >
> > There will always be a clash between generic programming allowing
> > you to
> > plug your own transform/interpolator and a specialized optimized
> > versions :)
> >
> > --
> > karthik
> >
> > Am I right? If so, Is it already implmented and I am out of
> > > luck?
> > >
> > >
> > > Sohan
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070322/0f4110d8/attachment.html


More information about the Insight-users mailing list