-//------------------------------------------------------------------------------
-void vvToolRigidReg::InputIsSelected(std::vector<vvSlicerManager *> & l)
-{
- //inputs
- mInput1 = l[0];
- mInput2 = l[1];
- mTwoInputs = true;
- SetOverlay();
- this->mImageSize=mCurrentSlicerManager->GetImage()->GetSize();
-
- SetRotationCenter();
- SetSliderRanges();
-
- //connect all sigs to slots
- connect(resetbutton, SIGNAL(pressed()), this, SLOT(ResetTransform()));
-
- connect(Xval, SIGNAL(editingFinished()), this, SLOT(SetXvalue()));
- connect(Yval, SIGNAL(editingFinished()), this, SLOT(SetYvalue()));
- connect(Zval, SIGNAL(editingFinished()), this, SLOT(SetZvalue()));
-
- connect(xtrans_slider, SIGNAL(sliderReleased()), this, SLOT(SetOrderXtrans()));
- connect(ytrans_slider, SIGNAL(sliderReleased()), this, SLOT(SetOrderYtrans()));
- connect(ztrans_slider, SIGNAL(sliderReleased()), this, SLOT(SetOrderZtrans()));
- connect(xrot_slider, SIGNAL(sliderReleased()), this, SLOT(SetOrderXrot()));
- connect(yrot_slider, SIGNAL(sliderReleased()), this, SLOT(SetOrderYrot()));
- connect(zrot_slider, SIGNAL(sliderReleased()), this, SLOT(SetOrderZrot()));
-
-
- connect(xtrans_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateXtranslider()));
-
- connect(ytrans_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateYtranslider()));
- connect(ztrans_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateZtranslider()));
-
-
- connect(xrot_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateXrotslider()));
- connect(yrot_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateYrotslider()));
- connect(zrot_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateZrotslider()));
-
-
- connect(xtrans_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateXtransb()));
- connect(ytrans_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateYtransb()));
- connect(ztrans_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateZtransb()));
- connect(xrot_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateXrotsb()));
- connect(yrot_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateYrotsb()));
- connect(zrot_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateZrotsb()));
-
-
- connect(loadbutton, SIGNAL(pressed()), this, SLOT(ReadFile()));
- connect(savebutton, SIGNAL(pressed()), this, SLOT(SaveFile()));
-}
-//------------------------------------------------------------------------------
+ //default image rotation center is the center of the image
+ QString xcord,ycord,zcord;
+ std::vector<double> imageorigin;
+ 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]-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);