[vtkusers] Using an itkAffineTransformation as input to vtkTransform

Lars Friedrich Lars lars-friedrich at gmx.net
Thu Aug 5 04:48:07 EDT 2010


Hi Peter,

how exactly do you convert the ITK-transform into VTK-representation?

If you check out the "insight-applications", you will find a class named "vtkRegistrationMonitor" (somewhere in the auxiliary subfolder). The essential source lines are:

  TransformType::MatrixType matrix = 
    this->ObservedTransform->GetMatrix();

  TransformType::OffsetType offset = 
    this->ObservedTransform->GetOffset();

  for(unsigned int i=0; i<3; i++ )
    {
    for(unsigned int j=0; j<3; j++ )
      {
      this->Matrix->SetElement(i,j,
        matrix.GetVnlMatrix().get(i,j));   
      }

    this->Matrix->SetElement( i, 3, offset[i]);
    }


where this->Matrix is the VTK matrix and this->ObservedTransform is the ITK transform. As long as ObservedTransform is derived from MatrixOffsetTransformBase, this approach works (and is correct).

regards,

lars





-------- Original-Nachricht --------
> Datum: Wed, 4 Aug 2010 19:43:09 +0200
> Von: "Boettcher, PD Dr. Peter" <Boettcher at kleintierklinik.uni-leipzig.de>
> An: vtkusers at vtk.org
> CC: "Braeuer, Sabine" <braeuer at kleintierklinik.uni-leipzig.de>
> Betreff: [vtkusers] Using an itkAffineTransformation as input to vtkTransform

> Dear All 
> 
> We performed affine image registration using the itk image registration
> pipeline. As result we got the 16 parameters from the
> itkAffineTransformation. Now, we would like to feed this transformation matrix to vtkTransform and
> apply the transformation to a polydata model using
> vtkTransformPolyDataFilter. The 3D-model has been generated using vtkMarchingCubeFilter using
> exactly the same image volume we used for image registration as the moving
> volume. Both image volumes feed to the registration pipeline have been centered
> on global 0,0,0 coordinate in a preprocessing step (before generating the
> 3D-moving model). 
> 
> Our current problem is that the 16 parameters copied from
> itkAffineTransform to vtkTransform do not result into the same transformation of the
> 3D-modell than of the image volume. 
> 
> Any help would be appreciated - Peter & Sabine.
>  
> ------------------------------------
> Peter Böttcher, Dr med vet habil, DipECVS
> European Veterinary Specialist in Surgery
> Fachtierarzt für Kleintierchirurgie
> Klinik für Kleintiere 
> Universität Leipzig 
> An den Tierkliniken 23 
> D-04103 Leipzig (Germany)
> Tel: +49-341-9738700 
> Fax: +49-341-9738799
> email: boettcher at kleintierklinik.uni-leipzig.de
> 

-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl



More information about the vtkusers mailing list