title: Python, C++ VTK Affine transformation
body: <p>My first question here. I am working to a visualization pipeline with the vtk library (neuroimaging data). However, I am really struggling with the affine handling. From the documentation (example, doxygen, books) It seems I should use something like this:</p>
  
  <pre><code>transform = vtkTransform()
  matrix_vtk =vtkMatrix4x4()
  matrix_vtk.DeepCopy((1, 0, 0, 0, 0, 1, 0, 1, 0,0,1,0,0,0,0,1))
  transform.SetMatrix(matrix_vtk)
  transform_filter = vtkTransformPolyDataFilter()
  transform_filter.SetTransform(transform)
  dataset_mapper = vtk.vtkDataSetMapper()
  dataset_mapper.SetInputConnection(transform_filter.GetOutputPort())
  actor.SetMapper(dataset_mapper)
  </code></pre>
  
  <p>However the results are not those I expected :D
  The complete code is:</p>
  
  <pre><code>from vtk import *
  
  fname_trk = "test/L113619_imfs_d10_110mm.trk"
  fname_vtk = "test/L113619_imfs_d10.vtk"
  fname_ply = "test/113619_Lwhite.ply"
  
  reader = vtkPLYReader()
  reader.SetFileName(fname_ply)
  reader_vtk = vtkPolyDataReader()
  reader_vtk.SetFileName(fname_vtk)
  
  ren = vtkRenderer()
  wren = vtkRenderWindow()
  iren = vtkRenderWindowInteractor()
  wren.AddRenderer(ren)
  iren.SetRenderWindow(wren)
  mapper = vtkPolyDataMapper()
  mapper.SetInputConnection(reader.GetOutputPort())
  mapper_vtk = vtkPolyDataMapper()
  mapper_vtk.SetInputConnection(reader_vtk.GetOutputPort())
  actor = vtkActor()
  actor.SetMapper(mapper)
  actor_vtk = vtkActor()
  # actor_vtk.SetMapper(mapper_vtk)
  ren.AddActor(actor_vtk)
  ren.AddActor(actor)
  
  transform = vtkTransform()
  matrix_vtk =vtkMatrix4x4()
  matrix_vtk.DeepCopy((1, 0, 0, 0, 0, 1, 0, 1, 0,0,1,0,0,0,0,1))
  transform.SetMatrix(matrix_vtk)
  transform_filter = vtkTransformPolyDataFilter()
  transform_filter.SetTransform(transform)
  dataset_mapper = vtk.vtkDataSetMapper()
  dataset_mapper.SetInputConnection(transform_filter.GetOutputPort())
  actor.SetMapper(dataset_mapper)
  actor.SetMapper(datasetmapper)
  
  iren.Initialize()
  iren.Start()
  </code></pre>
  
  <p>Any suggestions?</p>