[Insight-users] SupportIndex in BSplineInterpolationWeightFunction

Bing Jian bjian at cise.ufl.edu
Wed, 4 Feb 2004 08:33:23 -0500 (EST)


Hi Lydia,

   Thanks a lot for your explanation.

   I guess the point lies in here:
> And the details of the coefficient image to be:
> Spacing = [1.0, 1.0]
> Origin = [-1.5, -1.5]
   But where do you set the origin to be [-splineorder/2,
-splineorder/2]? I noticed there is a member named
m_offset=SplineOrder/2, but in the test program
BSplineDeformableTransformTest.cxx, I only see
  origin.Fill(0.0);
  transform->SetGridOrigin(origin);
So I think the origin for coefficient image should be set
to [0,0]. That's why I am confused.



-- 
Best wishes,
Bing Jian
bjian at cise.ufl.edu


On Tue, 3 Feb 2004, Lydia Ng wrote:

> Hi Bing,
>
> I am a bit confused as to which index you are referring there is (a) index
> with respect to the real image and (b) index with respect to the coefficient
> image. In
> itk::BSplineInterpolationWeightFunction::Evaluate(index,weights,supportIndex)
> both index and supportIndex are with respect to the coefficient image.
>
> In your example,
>
> >     *   *   *   *   *   *   *
> >
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >
> >     *   *   *   *   *   *   *
>
> The "+" denotes pixels of the real image and "*" denotes the pixels of the
> coefficient image.
>
> Suppose the real image is defined such that:
> Spacing = [1.0, 1.0]
> Origin = [0.0, 0.0]
> LargestPossibleRegion : Index = [0,0], Size = [4,4]
>
> And the details of the coefficient image to be:
> Spacing = [1.0, 1.0]
> Origin = [-1.5, -1.5]
> LargestPossibleRegion : Index = [0,0], Size = [7,7]
>
> Suppose I want to compute the value at point [0.0, 0.0].
> This point corresponds to index [0,0] of the real image and
> Index [1.5,1.5] of the coefficient image.
>
> Therefore the first argument of Evaluate(index,weights,startIndex)
> Is [1.5,1.5] and thus
> startIndex = floor(index[j] - splineorder/2) = [0,0]
>
> Is this what you mean? Or did I misinterpret your question?
>
> - Lydia
>
> > -----Original Message-----
> > From: Bing Jian [mailto:bjian at cise.ufl.edu]
> > Sent: Tuesday, February 03, 2004 5:59 PM
> > To: Insight-users at itk.org
> > Subject: [Insight-users] SupportIndex in
> > BSplineInterpolationWeightFunction
> >
> > Hi, Luis,
> >
> >    I came across some code in itkBSplineDeformableTransform and
> > itkBSplineInterpolationWeightFunction and got one question on
> > the support index.
> >    In itkBSplineDeformableTransform::Transform(),
> > there is a call:  m_WeightsFunction->Evaluate(index,
> > weights,supportIndex).
> > I understand supportIndex is supposed to be used in extraction of the
> > supportRegion from CoefficientImage.  But I am wondering the computation
> > of
> > this supportindex which is implemented in
> > BSplineInterpolationWeightFunction::Evaluate().
> >    The supportindex (or the startindex) is set to be
> >           floor(index[j] - splineorder/2)
> >   Is it correct? for example, if index = [0,0], splineorder = 3, then
> > supportindex will be negative number. In this case, I think, the
> > correct formula should be simply floor(index[j]) but their origins
> > are in different positions.
> >
> >     To make things clear, let me give a simple illustration below.
> > Suppose splineorder = 3, the size of real image is divided into 4*4
> > patches (denoted by +) and coefficient image is 7*7 (denoted by *)
> > The pixels in upperleft patch is controled by the upperleft 4*4
> > control points. In this case, floor(index) = 0 and supportindex
> > should also be 0. Am I right?
> >
> >     *   *   *   *   *   *   *
> >
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >           +   +   +   +
> >     *   *   *   *   *   *   *
> >
> >     *   *   *   *   *   *   *
> >
> >
> >     Thanks in advance!
> >
> > --
> > Best wishes,
> > Bing Jian
> > bjian at cise.ufl.edu
> >
> >
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>