From: srit Date: Thu, 3 Mar 2011 14:01:15 +0000 (+0000) Subject: Compose transformation in .mat with current transformation X-Git-Tag: v1.2.0~206 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=74239248be7a5478e7beb10b2df15831cd3759a9;p=clitk.git Compose transformation in .mat with current transformation --- 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(); } } //------------------------------------------------------------------------------