From 74239248be7a5478e7beb10b2df15831cd3759a9 Mon Sep 17 00:00:00 2001 From: srit Date: Thu, 3 Mar 2011 14:01:15 +0000 Subject: [PATCH] Compose transformation in .mat with current transformation --- vv/vvImageReader.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vv/vvImageReader.cxx b/vv/vvImageReader.cxx index d0db598..0076bf7 100644 --- a/vv/vvImageReader.cxx +++ b/vv/vvImageReader.cxx @@ -166,9 +166,16 @@ void vvImageReader::ReadMatImageTransform() f.close(); itk::Matrix itkMat = clitk::ReadMatrix3D(filename); + + vtkSmartPointer transform = vtkSmartPointer::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(); } } //------------------------------------------------------------------------------ -- 2.47.1