Margins around shapes
Eduard Schreibmann and Michael Lahanas
PDF File of this page
In radiotherapy the planning target volume (PTV) includes a region around the cancerous volume and therefore an expanded version of the PTV is required.
Figure 1 Margin around an object
We consider the general problem to obtain an expanded or compressed version of an object that its boundaries are given by points such as vertices of a triangulated surface.
In radiotherapy structures are usually given by points of contours that are parallel. The objects are described in a bounding box with coordinates the minimum and maximum values of the x, y and z coordinates of all points.
Figure 2 Objects defined in radiotherapy are usually defined by parallel contours
We consider the case to include individual values for margins for the 6 directions in the positive and negative directions in 3D.
The bounding box limits are transformed according to
(xmin, xmax) → (xmin + xm, xmax + xp)
(ymin, ymax) → (ymin + ym, ymax + yp)
(zmin, zmax) → (zmin + zm, ymax + zp)
The margins parameters are
(xm, xp) for the lower and upper x range
(ym, yp) for the lower and upper y range
(zm, zp) for the lower and upper z range
Figure 3 Anisotropic margins can be applied using different margin in the six directions of the bounding box.
The transformation is defined by a set of source and target landmarks. Any point close to a source landmark will be moved to a place close to the corresponding target landmark. The points in between are interpolated smoothly using a spline transformation algorithm. The source points are defined as the corners of the bounding box. The target points are shifted from the source points by “inflating” the bounding box, along each axis with the defined distance for the margin.
The advantage of this method over other methods is that it allows the construction of a non-isotropic margin that can be applied on both convex and concave surfaces. A set of eight points is chosen on the corners of the initial bounding box. The target points are arranged on a second box, shifted from the original box by user-defined margin distances for each axis. When the transformation is applied, the structure is “inflated” resulting in a non-isotropic margin around the initial object.
Figure 4 Example of isotropic margin
Figure 5 Example of anisotropic margin
It is based on the “ThinPlateSplineTransform” transformation that describes a nonlinear warp transform defined by a set of source and target landmarks using Booksteins Thin Plate Spline algorithm.
VTK method uses the transforms
vtkThinPlateSplineTransform.cpp a subclass of the transform vtkLandmarkTransform.cpp
Example of VTK code
Figure 6 Numbering of vertices of the bounding box used
Object to be deformed
Spline transformation source points
Spline transformation target points
The Spline transformation source points
The transformation used to rescale PTV points
VTK class to perform transformation of PTV points
Set PTV input
void SetInput(vtkPolyData * I);
Get PTV margin
Constructor of objects and possible user interface
Deform object according to specified margins
Get coordinates of object
void SetInput(vtkPolyData * I)
Input->DeepCopy( I );
float bounds; Input->GetBounds( bounds);
Return of result
Input = vtkPolyData::New();
SourcePoints = vtkPoints::New();
SourcePoints->SetNumberOfPoints( 8 );
TargetPoints = vtkPoints::New();
TargetPoints->SetNumberOfPoints( 8 );
ThinPlateTransform = vtkThinPlateSplineTransform::New();
ThinPlateTransform->SetSourceLandmarks( SourcePoints );
ThinPlateTransform->SetTargetLandmarks( TargetPoints );
GeneralTransform = vtkGeneralTransform::New();
GeneralTransform->SetInput( ThinPlateTransform );
GeneralTransform->Concatenate( ThinPlateTransform );
TransformFilter = vtkTransformPolyDataFilter::New();
TransformFilter->SetInput( Input );
TransformFilter->SetTransform( GeneralTransform );
Free allocated memory
The main function for the deformation of the object
Returns bounding box in the form (xmin, xmax, ymin, ymax, zmin, zmax) = (b, b, b, b, b, b)
float b; Input->GetBounds(b);
Take Source Points of bounding box
SourcePoints->SetPoint( 0, b, b, b );
SourcePoints->SetPoint( 1, b, b, b );
SourcePoints->SetPoint( 2, b, b, b );
SourcePoints->SetPoint( 3, b, b, b );
SourcePoints->SetPoint( 4, b, b, b );
SourcePoints->SetPoint( 5, b, b, b );
SourcePoints->SetPoint( 6, b, b, b );
SourcePoints->SetPoint( 7, b, b, b );
Give Coordinates of expanded bounding box
TargetPoints->SetPoint( 0, b+xm, b+yp, b+zp );
TargetPoints->SetPoint( 1, b+xp, b+yp, b+zp );
TargetPoints->SetPoint( 2, b+xm, b+yp, b+zm );
TargetPoints->SetPoint( 3, b+xp, b+yp, b+zm );
TargetPoints->SetPoint( 4, b+xm, b+ym, b+zp );
TargetPoints->SetPoint( 5, b+xp, b+ym, b+zp );
TargetPoints->SetPoint( 6, b+xm, b+ym, b+zm );
TargetPoints->SetPoint( 7, b+xp, b+ym, b+zm );
VTK class vtkTransformPolyDataFilter to perform transformation of points
TransformFilter->SetInput( Input );
Update the modification time for this object. Many filters rely on the modification time to determine if they need to recompute their data.
The Spline transformation source points vtkThinPlateSplineTransform
For objects that are not aligned to the x-y-z coordinate system it is recommended to use as the bounding box the optimal oriented box. The geometrical transformations are described in this article.
The method can be applied for other problems such as registration or corrections of deformations if a corresponding set of source and target points is given.
Fred L. Bookstein (1997) "Shape and the Information in Medical Images: A Decade of the Morphometric Synthesis" Computer Vision and Image Understanding 66 97-118
Berthold K. P. Horn (1987) "Closed-form solution of absolute orientation using unit quaternions," Journal of the Optical Society of America A, 4 629-642 and online work published by Tim Cootes at http://www.wiau.man.ac.uk/~bim