[Insight-users] BSplineDeformableTransform -- Region Setting

Lydia Ng lng at insightful . com
Tue, 9 Dec 2003 14:31:43 -0800


Hi Bing,

The BSplineDeformableTransform represents a deformation field by a =
*regular*
grid of B-spline coefficients (one set of coefficient per dimension).

Say if you have a 256 x 256 ( zero origin, unit spacing) image and you =
want
to place a 5 x 5 grid inside the image.

Then in this case the grid region is defined as

   typedef TransformType::RegionType RegionType;
   RegionType region;
   RegionType::SizeType   size;
   size.Fill( 5 );
   region.SetSize( size );

   transform->SetGridRegion( region );


Next you have to locate the grid with respect to the image in physical
origin.

For example if you want the edge of the grid to coincide with the edge =
of the
image then you set the grid origin to zero and grid spacing =
(256-1)/(5-1) =3D
63.75

Note that you have to keep in mind that BSpline computation requires a =
finite
support region (1 grid node to the left and 2 grid nodes to the right =
for a
spline order of 3).

For example if you want to make sure the deformation is defined for the =
whole
image you have to extend the grid outside of the image.

E.g. grid size =3D (5+3=3D8) x (5+3=3D8)=20
     Grid origin =3D (-63.75, 63.75)
     Grid spacing =3D (63.75, 63.75)


Does this help?

- Lydia

> -----Original Message-----
> From: Bing Jian [mailto:bjian at cise . ufl . edu]
> Sent: Tuesday, December 09, 2003 1:56 PM
> To: Insight-Users at itk . org
> Cc: iajesse
> Subject: [Insight-users] BSplineDeformableTransform -- Region Setting
>=20
>=20
> Hi, Luis,
>=20
>    I am reading the source code of BSplineDeformableTransform class
> and have following questions regarding the comments in header file
> itkBsplineDeformableTransform.h and the test program in ...test.cxx.
>=20
>    The first thing is about the region setting.
>=20
>  In example usage at the beginning of the header file, we see
>=20
>    ...
>    transform->SetGridRegion( region );
>    ...
>    // NB: the region must be set first before setting the parameters
>=20
>  and in Testing/Code/Common/itkBSplineDeformableTransformTest.cxx,
> the corresponding code is listed as below:
>=20
>   /**
>    * Define the deformable grid region, spacing and origin
>    */
>   typedef TransformType::RegionType RegionType;
>   RegionType region;
>   RegionType::SizeType   size;
>   size.Fill( 10 );
>   region.SetSize( size );
>   std::cout << region << std::endl;
>=20
>   My question is what's the meaning of this region. Does it mean
> we have 10^N grid/control points where N is the image dimension?
> Is this number 10^N the one represented by N-D in comments?
>=20
> And then we have
>=20
>   typedef TransformType::SpacingType SpacingType;
>   SpacingType spacing;
>   spacing.Fill( 2.0 );
>=20
>   typedef TransformType::OriginType OriginType;
>   OriginType origin;
>   origin.Fill( 0.0 );
>=20
>   transform->SetGridSpacing( spacing );
>   transform->SetGridOrigin( origin );
>   transform->SetGridRegion( region );
>=20
> in this case, how are those control points selected? Could you
> please enumerate a few points with index?
>=20
>   Thanks!
>=20
>  (to be continued :-)
>=20
>=20
> --
> Best wishes,
> Bing Jian
> bjian at cise . ufl . edu
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users