{
// GUI Initialization
Ui_vvToolRigidReg::setupUi(mToolWidget);
+ QSize qsize;
+ qsize.setHeight(170);
+ qsize.setWidth(650);
+ textEdit->setFixedSize(qsize);
// Set how many inputs are needed for this tool
AddInputSelector("Select the Reference Image");
AddInputSelector("Select the Target Image");
- mOrder=QString("Rotation Order: ");
-
-
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvToolRigidReg::close()
-{
-
+{
+
return vvToolWidgetBase::close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolRigidReg::reject()
{
- mInput2->Reload();
- for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers();i++)
- {
- mInput1->GetSlicer(i)->RemoveActor("overlay",0);
- mInput1->SetColorMap(0);
- mInput1->Render();
- }
+ ResetTransform();
return vvToolWidgetBase::reject();
}
//------------------------------------------------------------------------------
//inputs
mInput1 = l[0];
mInput2 = l[1];
+ if(mInput1->GetFileName()==mInput2->GetFileName())
+ {
+ QMessageBox::information(this, "Warning","Your Reference and Target Images are the same");
+ }
mTwoInputs = true;
SetOverlay();
- this->mImageSize=mCurrentSlicerManager->GetImage()->GetSize();
+ mImageSize=mInput1->GetImage()->GetSize();
SetRotationCenter();
SetSliderRanges();
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()));
//------------------------------------------------------------------------------
void vvToolRigidReg::apply()
{
- std::ostringstream osstream;
- osstream << "Transformed_"
- << mInput2->GetSlicer(0)->GetFileName() << ".mhd";
- AddImage(mInput2->GetImage(),osstream.str());
- QApplication::restoreOverrideCursor();
- close();
+ QMessageBox mb( "Keep Overlay",
+ "Do you want to keep the overlay on?\n"
+ "You can switch it off anytime by pressing 'x'",
+ QMessageBox::Information,
+ QMessageBox::Yes | QMessageBox::Default,
+ QMessageBox::No,
+ QMessageBox::Cancel | QMessageBox::Escape );
+ mb.setButtonText( QMessageBox::Yes, "Yes" );
+ mb.setButtonText( QMessageBox::No, "No" );
+ switch( mb.exec() ) {
+ case QMessageBox::Yes:
+ hide();
+ break;
+ case QMessageBox::No:
+ mInput2->Reload();
+ mInput2->Render();
+ mInput1->Reload();
+ mInput1->Render();
+ for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers();i++)
+ {
+ mInput1->RemoveActor("overlay",0);
+ mInput1->SetColorMap(0);
+ mInput1->Render();
+ hide();
+ }
+ break;
+ case QMessageBox::Cancel:
+ break;
+ }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolRigidReg::SetOverlay()
{
- mCurrentSlicerManager=mInput2;
- for (int i =0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
- mInput1->GetSlicer(i)->SetOverlay(mInput2->GetImage());
- mInput1->GetSlicer(i)->SetActorVisibility("overlay",0,true);
- mInput1->SetColorMap();
- mInput1->Render();
+ for (int i =0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ mCurrentSlicerManager->GetSlicer(i)->SetOverlay(mInput2->GetImage());
+ mCurrentSlicerManager->GetSlicer(i)->SetActorVisibility("overlay",0,true);
+ mCurrentSlicerManager->SetColorMap();
+ mCurrentSlicerManager->Render();
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolRigidReg::SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ)
+void vvToolRigidReg::SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ,bool update)
{
vtkSmartPointer<vtkTransform> transform = mCurrentSlicerManager->GetImage()->GetTransform();
}
//Translations
if (tX!=0||tY!=0||tZ!=0)
- transform->Translate(tX,tY,tZ);
+ transform->Translate(tX*mInput1->GetImage()->GetSpacing()[0],tY*mInput1->GetImage()->GetSpacing()[1],tZ*mInput1->GetImage()->GetSpacing()[2]);
transform->Update();
-
- for (int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
- mCurrentSlicerManager->GetImage()->UpdateReslice();
- mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
- mCurrentSlicerManager->GetSlicer(i)->Render();
+ if(update)
+ {
+ for (int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ mCurrentSlicerManager->GetImage()->UpdateReslice();
+ mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
+ mCurrentSlicerManager->GetSlicer(i)->Render();
+ }
}
}
//------------------------------------------------------------------------------
{
vtkSmartPointer<vtkTransform> transform =mCurrentSlicerManager->GetImage()->GetTransform();
transform->SetMatrix(matrix);
- // mCurrentSlicerManager->GetImage()->SetTransform(transform);
transform->PostMultiply();
transform->Concatenate(matrix);
transform->Update();
mCurrentSlicerManager->GetImage()->SetTransform(transform);
+
for (int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
- mCurrentSlicerManager->GetImage()->UpdateReslice();
- mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
- mCurrentSlicerManager->GetSlicer(i)->Render();
- }
+ mCurrentSlicerManager->GetImage()->UpdateReslice();
+ mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
+ mCurrentSlicerManager->GetSlicer(i)->Render();
+ }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
- void vvToolRigidReg::UpdateTextEditor(vtkMatrix4x4 *matrix,QString SetOrder)
+ void vvToolRigidReg::UpdateTextEditor(vtkMatrix4x4 *matrix)
{
QString str1,str2,str3;
-
QColor color;
textEdit->clear();
textEdit->setAcceptRichText(true);
+
str2=textEdit->toPlainText();
str2.append("Rotation Center(mm): \n");
textEdit->setText(str2);
str2=textEdit->toPlainText();
- str2.append("Transformation Matrix:\n");
+ str2.append("Transformation Matrix(mm):\n");
textEdit->setText(str2);
-
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
str2=textEdit->toPlainText();
- str2.append("\t"+str1.setNum(matrix->Element[i][j]));
+ // str2.append("\t"+str1.setNum(matrix->Element[i][j]));
+ str2.append(QString("%1\t").arg(str1.setNum(matrix->Element[i][j]),20));
textEdit->setText(str2);
}
str2=textEdit->toPlainText();
textEdit->toPlainText().toAscii();
str2=textEdit->toPlainText();
- mOrder+=SetOrder+QString(" ");
- str2.append(mOrder);
textEdit->setText(str2);
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-void vvToolRigidReg::SetOrderXtrans()
-{
- if(mOrder.size()-mOrder.lastIndexOf("Tx")<10) //see if the same Transformation Parameter has been used back to back
- mOrder.chop(mOrder.size()-mOrder.lastIndexOf("Tx"));
- UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Tx: ")+xtrans_sb->text());
-}
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-void vvToolRigidReg::SetOrderYtrans()
-{
- if(mOrder.size()-mOrder.lastIndexOf("Ty")<10)
- mOrder.chop(mOrder.size()-mOrder.lastIndexOf("Ty"));
- UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Ty: ")+ytrans_sb->text());
-}
-
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-void vvToolRigidReg::SetOrderZtrans()
-{
- if(mOrder.size()-mOrder.lastIndexOf("Tz")<10)
- mOrder.chop(mOrder.size()-mOrder.lastIndexOf("Tz"));
- UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Tz: ")+ztrans_sb->text());
-}
-
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-void vvToolRigidReg::SetOrderXrot()
-{
- if(mOrder.size()-mOrder.lastIndexOf("Rx")<10)
- mOrder.chop(mOrder.size()-mOrder.lastIndexOf("Rx"));
- UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Rx: ")+xrot_sb->text());
-}
-
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-void vvToolRigidReg::SetOrderYrot()
-{
- if(mOrder.size()-mOrder.lastIndexOf("Ry")<10) //see if the same Transformation Parameter has been used back to back
- mOrder.chop(mOrder.size()-mOrder.lastIndexOf("Ry"));
- UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Ry: ")+yrot_sb->text());
-}
-
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-void vvToolRigidReg::SetOrderZrot()
-{
- if(mOrder.size()-mOrder.lastIndexOf("Rz")<10) //see if the same Transformation Parameter has been used back to back
- mOrder.chop(mOrder.size()-mOrder.lastIndexOf("Rz"));
- UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Rz: ")+zrot_sb->text());
-}
-//------------------------------------------------------------------------------
-
//------------------------------------------------------------------------------
void vvToolRigidReg::UpdateXtransb()
{
int diff=0;
diff=xtrans_sb->value()-xtrans_slider->value();
- this->SetTransform(diff, 0, 0, 0, 0, 0);
+ this->SetTransform(diff, 0, 0, 0, 0, 0,true);
xtrans_slider->setValue(xtrans_sb->value());
- // UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Tx:")+xtrans_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
{
int diff=0;
diff=xtrans_slider->value()-xtrans_sb->value();
- this->SetTransform(diff, 0, 0, 0, 0, 0);
+ this->SetTransform(diff, 0, 0, 0, 0, 0,true);
xtrans_sb->setValue(xtrans_slider->value());
- //UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Tx:")+xtrans_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
int diff=0;
diff=ytrans_sb->value()-ytrans_slider->value();
- this->SetTransform(0, diff, 0, 0, 0, 0);
+ this->SetTransform(0, diff, 0, 0, 0, 0,true);
ytrans_slider->setValue(ytrans_sb->value());
-// UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Ty:")+ytrans_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
{
int diff=0;
diff=ytrans_slider->value()-ytrans_sb->value();
- this->SetTransform(0, diff, 0, 0, 0, 0);
+ this->SetTransform(0, diff, 0, 0, 0, 0,true);
ytrans_sb->setValue(ytrans_slider->value());
-// UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Ty:")+ytrans_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
int diff=0;
diff=ztrans_sb->value()-ztrans_slider->value();
- this->SetTransform(0, 0, diff, 0, 0, 0);
+ this->SetTransform(0, 0, diff, 0, 0, 0,true);
ztrans_slider->setValue(ztrans_sb->value());
- // UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Tz:")+ztrans_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
{
int diff=0;
diff=ztrans_slider->value()-ztrans_sb->value();
- this->SetTransform(0, 0, diff, 0, 0, 0);
+ this->SetTransform(0, 0, diff, 0, 0, 0,true);
ztrans_sb->setValue(ztrans_slider->value());
-// UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Tz:")+ztrans_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
int diff=0;
diff=xrot_sb->value()-xrot_slider->value();
- this->SetTransform(0, 0, 0, diff, 0, 0);
+ this->SetTransform(0, 0, 0, diff, 0, 0,true);
xrot_slider->setValue(xrot_sb->value());
- // UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Rx:")+xrot_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
{
int diff=0;
diff=xrot_slider->value()-xrot_sb->value();
- this->SetTransform(0, 0, 0, diff, 0, 0);
+ this->SetTransform(0, 0, 0, diff, 0, 0,true);
xrot_sb->setValue(xrot_slider->value());
- // UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Rx:")+xrot_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
int diff=0;
diff=yrot_sb->value()-yrot_slider->value();
- this->SetTransform(0, 0, 0, 0, diff, 0);
+ this->SetTransform(0, 0, 0, 0, diff, 0,true);
yrot_slider->setValue(yrot_sb->value());
- // UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Ry:")+yrot_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
{
int diff=0;
diff=yrot_slider->value()-yrot_sb->value();
- this->SetTransform(0, 0, 0, 0, diff, 0);
+ this->SetTransform(0, 0, 0, 0, diff, 0,true);
yrot_sb->setValue(yrot_slider->value());
-// UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Ry:")+yrot_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
int diff=0;
diff=zrot_sb->value()-zrot_slider->value();
- this->SetTransform(0, 0, 0, 0, 0,diff);
+ this->SetTransform(0, 0, 0, 0, 0,diff,true);
zrot_slider->setValue(zrot_sb->value());
- // UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Rz:")+zrot_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
{
int diff=0;
diff=zrot_slider->value()-zrot_sb->value();
- this->SetTransform(0, 0, 0, 0, 0, diff);
+ this->SetTransform(0, 0, 0, 0, 0, diff,true);
zrot_sb->setValue(zrot_slider->value());
-// UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix(),QString("Rz:")+zrot_sb->text());
+ UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
}
//------------------------------------------------------------------------------
void vvToolRigidReg::SaveFile()
{
QString s = QFileDialog::getSaveFileName(this, tr("Save File"),
- "/home/bharath/clitk3_27Apr/clitk3/build/bin/text.txt",
+ "/home",
tr("Text (*.txt *.doc *.rtf)"));
QFile file(s);
if (file.open(QFile::WriteOnly | QFile::Truncate)) {
QTextStream out(&file);
- out << textEdit->toPlainText() ;
+ out<<textEdit->toPlainText() ;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolRigidReg::ReadFile()
-{
- QString parameters=QString("Tx: Ty: Tz:");
+{
+ vtkMatrix4x4 *matrix=vtkMatrix4x4::New();
vtkSmartPointer<vtkTransform> transform = mCurrentSlicerManager->GetImage()->GetTransform();
-
-
QString s = QFileDialog::getOpenFileName(
this,
"Choose a file",
- "/home/bharath/clitk3_27Apr/clitk3/build/bin/",
+ "/home",
"Text (*.txt *.rtf *.doc)");
+ if (s.isEmpty())
+ return;
+
QFile file(s);
ifstream readfile;
- std::string x;
+ std::string x= s.toStdString();
std::vector<QString> Qstr;
-
- readfile.open("text.txt");
+ readfile.open(x.c_str());
if (readfile.is_open())
{
while (!readfile.eof())
}
readfile.close();
}
- else cout << "Unable to open file";
-
- //Obtain the Rotation Center
+ else {
+ cout << "Unable to open file";
+ }
+ //Set the transformation matrix
+ int index =7;
+ for(int i=0;i<4;i++)
+ {
+ for(int j=0;j<4;j++)
+ {
+ matrix->Element[i][j]=Qstr.at(index).toDouble();
+ index++;
+ }
+ }
+ transform->SetMatrix(matrix);
+ // SetTransform(matrix);
+ double * orientations=new double[3];
+ double * translations=new double[3];
+ transform->GetOrientation(orientations);
+ transform->PostMultiply();
+
+ //Obtain the Rotation Center
Xval->setText(Qstr.at(2));
Yval->setText(Qstr.at(3));
Zval->setText(Qstr.at(4));
-
-// InitializeSliders();
- double * orientations=new double[4];
- double * translations=new double[3];
- transform->PostMultiply();
- //Works currently wit the ROtation order Y Z X
+
+ //In the Order or Y X Z //
+ //now postmultiply for the rotations
+ SetTransform(0,0,0,0,0,-orientations[2],false);
+ SetTransform(0,0,0,-orientations[0],0,0,false);
+ SetTransform(0,0,0,0,-orientations[1],0,false);
+
transform->GetPosition(translations);
- transform->GetOrientation(orientations);
- /* xtrans_slider->setValue(Qstr.at(10).toDouble());
- UpdateXtranslider();
- ytrans_slider->setValue(Qstr.at(14).toDouble());
- UpdateYtranslider();
- ztrans_slider->setValue(Qstr.at(18).toDouble());
- UpdateZtranslider();
-*/
- DD(translations[0]);
- DD(translations[1]);
- DD(translations[2]);
+ transform->Identity();
+
+ /* DD(translations[0]/mInput1->GetImage()->GetSpacing()[0]);
+ DD(translations[1]/mInput1->GetImage()->GetSpacing()[1]);
+ DD(translations[2]/mInput1->GetImage()->GetSpacing()[2]);
DD(orientations[0]);
DD(orientations[1]);
- DD(orientations[2]);
- DD(orientations[3]);
- DD(*transform->GetMatrix());
- //Obtain the Transformation Matrix
- /*QString str;
- str=QString(value.at(10).c_str());
- DD(str.toStdString());
- */
-// DD(value[6]);
- // DD(value[10]);
- //put the streamed values in matrix array
- /* for(int i=0;i<4;i++)
- {
- for(int j=0;j<4;j++)
- {
- matrix->Element[i][j]=value[i*4+j];
- }
- }
- SetTransform( matrix);*/
-
- /*xtrans_slider->setValue(value.at(10));
- ytrans_slider->setValue(value.at(14));
- ztrans_slider->setValue(value.at(18));
- UpdateXtranslider();
- UpdateYtranslider();
- UpdateZtranslider();*/
+ DD(orientations[2]);*/
+ //set the sliders and spin box values
+ xtrans_slider->setValue(round(translations[0]/mInput1->GetImage()->GetSpacing()[0]));
+ UpdateXtranslider();
+ ytrans_slider->setValue(round(translations[1]/mInput1->GetImage()->GetSpacing()[1]));
+ UpdateYtranslider();
+ ztrans_slider->setValue(round(translations[2]/mInput1->GetImage()->GetSpacing()[2]));
+ UpdateZtranslider();
+ yrot_slider->setValue(round(orientations[1]));
+ UpdateYrotslider();
+ xrot_slider->setValue(round(orientations[0]));
+ UpdateXrotslider();
+ zrot_slider->setValue(round(orientations[2]));
+ UpdateZrotslider();
}
//------------------------------------------------------------------------------
{
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
matrix->Identity();
-
+ mInput1->Reload();
+ mInput1->Render();
+ mInput2->Reload();
+ mInput2->Render();
SetRotationCenter();
SetSliderRanges();
SetTransform(matrix);
- mOrder.clear();
- mOrder=QString("Rotation Order: ");
- UpdateTextEditor(matrix,mOrder);
+ UpdateTextEditor(matrix);
}
//------------------------------------------------------------------------------
//default image rotation center is the center of the image
QString xcord,ycord,zcord;
std::vector<double> imageorigin;
- imageorigin=mCurrentSlicerManager->GetImage()->GetOrigin();
+ imageorigin=mInput1->GetImage()->GetOrigin();
- xcord=xcord.setNum(imageorigin[0]+mImageSize[0]*mCurrentSlicerManager->GetImage()->GetSpacing()[0]/2, 'g', 3);
- ycord=ycord.setNum(imageorigin[1]+mImageSize[1]*mCurrentSlicerManager->GetImage()->GetSpacing()[1]/2, 'g', 3);
- zcord=zcord.setNum(imageorigin[2]+mImageSize[2]*mCurrentSlicerManager->GetImage()->GetSpacing()[2]/2, 'g', 3);
+ xcord=xcord.setNum(imageorigin[0]+mImageSize[0]*mInput1->GetImage()->GetSpacing()[0]/2, 'g', 3);
+ ycord=ycord.setNum(imageorigin[1]+mImageSize[1]*mInput1->GetImage()->GetSpacing()[1]/2, 'g', 3);
+ zcord=zcord.setNum(imageorigin[2]+mImageSize[2]*mInput1->GetImage()->GetSpacing()[2]/2, 'g', 3);
Xval->setText(xcord);
Yval->setText(ycord);