X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolRigidReg.cxx;h=29481651e21aad16311963d9557ea74155e107a1;hb=9c5f0e4d3d6b33e09d0413439ed7a867e3d85faa;hp=28591ba05ed1b6c6cc8af79af440ef5eaea6eb37;hpb=65a613313ab43ff6efc452b378f7569e68e883a2;p=clitk.git diff --git a/vv/vvToolRigidReg.cxx b/vv/vvToolRigidReg.cxx index 28591ba..2948165 100644 --- a/vv/vvToolRigidReg.cxx +++ b/vv/vvToolRigidReg.cxx @@ -30,6 +30,7 @@ // clitk #include "clitkTransformUtilities.h" +#include "clitkMatrix.h" // qt #include @@ -118,8 +119,9 @@ void vvToolRigidReg::InputIsSelected(vvSlicerManager *input) //backup original matrix for(int j=0; j<4; j++) for(int i=0; i<4; i++) - mInitialMatrix->SetElement(i,j, mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix()->GetElement(i,j)); - QString origTransformString = dynamic_cast(mMainWindow)->Get4x4MatrixDoubleAsString(mInitialMatrix); + // TODO SR and BP: check on the list of transforms and not the first only + mInitialMatrix->SetElement(i,j, mCurrentSlicerManager->GetImage()->GetTransform()[0]->GetMatrix()->GetElement(i,j)); + QString origTransformString(clitk::Get4x4MatrixDoubleAsString(mInitialMatrix).c_str()); transformationLabel->setText(origTransformString); SetTransform(mInitialMatrix); @@ -242,7 +244,8 @@ void vvToolRigidReg::SpinBoxChange(double newVal) } // Compute transform and set - vtkSmartPointer transform_final=mInput->GetImage()->GetTransform(); + // TODO SR and BP: check on the list of transforms and not the first only + vtkSmartPointer transform_final=mInput->GetImage()->GetTransform()[0]; transform_final->Identity(); transform_final->PostMultiply(); @@ -294,8 +297,9 @@ void vvToolRigidReg::SaveFile() QFile file(filename); if (file.open(QFile::WriteOnly | QFile::Truncate)) { - vtkMatrix4x4* matrix = mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(); - QString matrixStr = dynamic_cast(mMainWindow)->Get4x4MatrixDoubleAsString(matrix,16); + // TODO SR and BP: check on the list of transforms and not the first only + vtkMatrix4x4* matrix = mCurrentSlicerManager->GetImage()->GetTransform()[0]->GetMatrix(); + QString matrixStr = clitk::Get4x4MatrixDoubleAsString(matrix,16).c_str(); QTextStream out(&file); out << matrixStr; } @@ -332,7 +336,8 @@ void vvToolRigidReg::LoadFile() //------------------------------------------------------------------------------ void vvToolRigidReg::ChangeOfRotationCenter() { - SetTransform(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix()); + // TODO SR and BP: check on the list of transforms and not the first only + SetTransform(mCurrentSlicerManager->GetImage()->GetTransform()[0]->GetMatrix()); } //------------------------------------------------------------------------------ @@ -347,7 +352,8 @@ void vvToolRigidReg::ResetTransform() void vvToolRigidReg::SetTransform(vtkMatrix4x4 *matrix) { vtkSmartPointer transform=vtkSmartPointer::New(); - mCurrentSlicerManager->GetImage()->GetTransform()->SetMatrix(matrix); + // TODO SR and BP: check on the list of transforms and not the first only + mCurrentSlicerManager->GetImage()->GetTransform()[0]->SetMatrix(matrix); transform->Update(); Render(); dynamic_cast(mMainWindow)->ImageInfoChanged();