[Insight-users] SupportIndex in BSplineInterpolationWeightFunction

Lydia Ng lng at insightful.com
Tue, 3 Feb 2004 22:52:04 -0800


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,supportIn=
dex)
both index and supportIndex are with respect to the coefficient image.

In your example,

>     *   *   *   *   *   *   *
>=20
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>=20
>     *   *   *   *   *   *   *

The "+" denotes pixels of the real image and "*" denotes the pixels of =
the
coefficient image.

Suppose the real image is defined such that:
Spacing =3D [1.0, 1.0]
Origin =3D [0.0, 0.0]
LargestPossibleRegion : Index =3D [0,0], Size =3D [4,4]

And the details of the coefficient image to be:
Spacing =3D [1.0, 1.0]
Origin =3D [-1.5, -1.5]
LargestPossibleRegion : Index =3D [0,0], Size =3D [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 =3D floor(index[j] - splineorder/2) =3D [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
>=20
> Hi, Luis,
>=20
>    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 =3D [0,0], splineorder =3D 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.
>=20
>     To make things clear, let me give a simple illustration below.
> Suppose splineorder =3D 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) =3D 0 and supportindex
> should also be 0. Am I right?
>=20
>     *   *   *   *   *   *   *
>=20
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>           +   +   +   +
>     *   *   *   *   *   *   *
>=20
>     *   *   *   *   *   *   *
>=20
>=20
>     Thanks in advance!
>=20
> --
> Best wishes,
> Bing Jian
> bjian at cise.ufl.edu
>=20
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users