[vtkusers] New vtkTransform code finished

David Gobbi dgobbi at irus.rri.on.ca
Thu Jun 8 10:36:52 EDT 2000


Hi All,

The changes to vtkTransform are now complete (hard to believe that it's
been six months since I started!).  There are no fewer than 12 new
classes, which cover everything from an identity transform to a 
warp transform that allows you define individual displacement vectors
at each point in a 3D grid.  Thanks to Tim Hutton for contributing a 
class that allows you to define a linear registration matrix by simply
specifying two matching lists of fiducial coordinates, and
for contributing the initial thin plate splines implementation.
And to the Kitware folks (particularly Ken) for convincing me
that vtkTransform::SetInput() was a good idea, and that
vtkPerspectiveTransformConcatenation is a bad name for a class.
Finally, thanks to Bill Lorensen for all his work on the dashboard --
without constant regression testing I really doubt that a big
project like VTK could survive.

If you want to look at the finished product, go to 
http://www.visualizationtoolkit.org/vtk/quality/Doc/atoz.html
and look up vtkAbstractTransform.

There are four incompatibilities with VTK 3.1 that I know of:
1) vtkTransform::GetPoint() will print out a warning message if
   the matrix is in PreMultiply mode (the result of GetPoint is
   not the same as in PostMultiply mode!)
2) vtkTransform::Transpose() will work in all existing code, but will
   print a warning message.  It will _not_ work properly after you
   have called SetInput() on the transform.
3) vtkTransform::GetMatrix() returns a pointer, not a reference
4) direct modification of the matrix, e.g.
   transform->GetMatrixPointer()->SetPoint(i,j,x)
   will only work under certain circumstances (the circumstances
   are broad enough that almost all existing code should work)

There are also two efficiency issues:
1) GetMatrix(), GetMatrixPointer() have additional computational
   cost because some MTime checking is done before the matrix
   is returned.  Ditto for GetPoint() and MultiplyPoint().  Some
   of the other VTK classes will have to be changed to work around
   this. 
2) The first time Translate(), RotateWXYZ() etc. is called on
   a matrix, an extra, unnecessary matrix multiplication is done.
   I'll fix this sometime soon.  

Finally, if anyone is already using any of the new vtk*Transform
classes (i.e. any class other than the vtkTransform class)
please grab the latest VTK from CVS or the nightlies and correct
any warnings you see.  I have a few classes, 
e.g. vtkGeneralTransformConcatenation, which have been replaced
and which will be eliminated in a month or so.

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario





More information about the vtkusers mailing list