]> Creatis software - clitk.git/commitdiff
Use real image center as default rotation center
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 20 Feb 2012 13:09:56 +0000 (14:09 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 20 Feb 2012 13:09:56 +0000 (14:09 +0100)
vv/vvToolRigidReg.cxx

index 57d7bcb085329ba1d4d004fd8c5887824be80fe4..28591ba05ed1b6c6cc8af79af440ef5eaea6eb37 100644 (file)
@@ -108,9 +108,9 @@ void vvToolRigidReg::InputIsSelected(vvSlicerManager *input)
   imageorigin=mInput->GetImage()->GetOrigin();
   std::vector<int> imageSize = mInput->GetImage()->GetSize();
   std::vector<double> 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<QSlider *> transSliders, rotSliders;
   std::vector<QDoubleSpinBox *> transSBs, rotSBs;