From 22de7e66d9b3cee9c6bde1e674bdde0532bc21a2 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 20 Feb 2012 14:09:56 +0100 Subject: [PATCH] Use real image center as default rotation center --- vv/vvToolRigidReg.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vv/vvToolRigidReg.cxx b/vv/vvToolRigidReg.cxx index 57d7bcb..28591ba 100644 --- a/vv/vvToolRigidReg.cxx +++ b/vv/vvToolRigidReg.cxx @@ -108,9 +108,9 @@ void vvToolRigidReg::InputIsSelected(vvSlicerManager *input) imageorigin=mInput->GetImage()->GetOrigin(); std::vector imageSize = mInput->GetImage()->GetSize(); std::vector imageSpacing = mInput->GetImage()->GetSpacing(); - xcord=xcord.setNum(imageorigin[0]+imageSize[0]*imageSpacing[0]/2, 'g', 3); - ycord=ycord.setNum(imageorigin[1]+imageSize[1]*imageSpacing[1]/2, 'g', 3); - zcord=zcord.setNum(imageorigin[2]+imageSize[2]*imageSpacing[2]/2, 'g', 3); + xcord=xcord.setNum(imageorigin[0]+(imageSize[0]-1)*imageSpacing[0]*0.5, 'g', 3); + ycord=ycord.setNum(imageorigin[1]+(imageSize[1]-1)*imageSpacing[1]*0.5, 'g', 3); + zcord=zcord.setNum(imageorigin[2]+(imageSize[2]-1)*imageSpacing[2]*0.5, 'g', 3); Xval->setText(xcord); Yval->setText(ycord); Zval->setText(zcord); @@ -370,7 +370,6 @@ void vvToolRigidReg::SetTransform(vtkMatrix4x4 *matrix) euler->SetMatrix(rotMat); euler->SetOffset(transVec); - // Modify GUI according to the new parameters std::vector transSliders, rotSliders; std::vector transSBs, rotSBs; -- 2.47.1