]> Creatis software - clitk.git/commitdiff
Compose transformation in .mat with current transformation
authorsrit <srit>
Thu, 3 Mar 2011 14:01:15 +0000 (14:01 +0000)
committersrit <srit>
Thu, 3 Mar 2011 14:01:15 +0000 (14:01 +0000)
vv/vvImageReader.cxx

index d0db5988900f27531e78a4f139258c79dc1b0bd9..0076bf7663767d212d2306b7c52fe8c124fa012b 100644 (file)
@@ -166,9 +166,16 @@ void vvImageReader::ReadMatImageTransform()
     f.close();
     
     itk::Matrix<double, 4, 4> itkMat = clitk::ReadMatrix3D(filename);
+    
+    vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
+    transform->Identity();
     for(int j=0; j<4; j++)
       for(int i=0; i<4; i++)
-        mImage->GetTransform()->GetMatrix()->SetElement(j,i,itkMat[j][i]);
+        transform->GetMatrix()->SetElement(j,i,itkMat[j][i]);
+
+    mImage->GetTransform()->PostMultiply();
+    mImage->GetTransform()->Concatenate(transform->GetMatrix());
+    mImage->GetTransform()->Update();
   }
 }
 //------------------------------------------------------------------------------