]> Creatis software - clitk.git/blob - vv/vvToolRigidReg.cxx
add conversion utility from vtk to itk
[clitk.git] / vv / vvToolRigidReg.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #include "vvToolRigidReg.h"
19 #include <QComboBox>
20 #include <QCursor>
21 #include <QApplication>
22 #include <vtkImageData.h>
23 #include <vtkSmartPointer.h>
24 #include <vtkTransform.h>
25 #include "vvImage.h"
26 #include "vvSlicer.h"
27 #include <QFile>
28 #include <QString>
29 #include <QMessageBox>
30 #include <vvMainWindow.h>
31 #include <QFileDialog>
32 #include <QTextStream>
33 //------------------------------------------------------------------------------
34 // Create the tool and automagically (I like this word) insert it in
35 // the main window menu.
36 ADD_TOOL(vvToolRigidReg);
37 //------------------------------------------------------------------------------
38
39 //------------------------------------------------------------------------------
40 vvToolRigidReg::vvToolRigidReg(vvMainWindowBase * parent, Qt::WindowFlags f):
41     vvToolWidgetBase(parent, f),
42     vvToolBase<vvToolRigidReg>(parent),
43     Ui::vvToolRigidReg()
44 {
45   // GUI Initialization
46   Ui_vvToolRigidReg::setupUi(mToolWidget);
47    QSize qsize;
48    qsize.setHeight(170);
49    qsize.setWidth(650);
50    textEdit->setFixedSize(qsize);
51
52   // Set how many inputs are needed for this tool
53   AddInputSelector("Select the Reference Image");
54   AddInputSelector("Select the Target Image");
55 }
56 //------------------------------------------------------------------------------
57
58 //------------------------------------------------------------------------------
59 vvToolRigidReg::~vvToolRigidReg()
60 {
61 }
62 //------------------------------------------------------------------------------
63
64 //------------------------------------------------------------------------------
65 bool vvToolRigidReg::close()
66
67   
68   return vvToolWidgetBase::close();
69 }
70 //------------------------------------------------------------------------------
71
72 //------------------------------------------------------------------------------
73 void vvToolRigidReg::reject()
74 {
75     ResetTransform();
76   return vvToolWidgetBase::reject();
77 }
78 //------------------------------------------------------------------------------
79
80 //------------------------------------------------------------------------------
81 void vvToolRigidReg::InputIsSelected(std::vector<vvSlicerManager *> & l)
82 {
83   //inputs
84   mInput1 = l[0];
85   mInput2 = l[1];
86   if(mInput1->GetFileName()==mInput2->GetFileName())
87   {  
88     QMessageBox::information(this, "Warning","Your Reference and Target Images are the same");
89   } 
90   mTwoInputs = true;
91   SetOverlay();
92   mImageSize=mInput1->GetImage()->GetSize();
93   
94   SetRotationCenter();
95   SetSliderRanges();
96   
97     //connect all sigs to slots 
98   connect(resetbutton, SIGNAL(pressed()), this, SLOT(ResetTransform()));
99   
100   connect(Xval, SIGNAL(editingFinished()), this, SLOT(SetXvalue()));
101   connect(Yval, SIGNAL(editingFinished()), this, SLOT(SetYvalue()));
102   connect(Zval, SIGNAL(editingFinished()), this, SLOT(SetZvalue()));
103   connect(xtrans_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateXtranslider()));
104     
105   connect(ytrans_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateYtranslider()));
106   connect(ztrans_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateZtranslider()));
107   
108   
109   connect(xrot_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateXrotslider()));
110   connect(yrot_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateYrotslider()));
111   connect(zrot_slider, SIGNAL(valueChanged(int)), this, SLOT(UpdateZrotslider()));
112   
113         
114    connect(xtrans_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateXtransb()));
115    connect(ytrans_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateYtransb()));
116    connect(ztrans_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateZtransb()));
117    connect(xrot_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateXrotsb()));
118    connect(yrot_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateYrotsb()));
119    connect(zrot_sb, SIGNAL(valueChanged(int)), this, SLOT(UpdateZrotsb()));
120    
121   
122   connect(loadbutton, SIGNAL(pressed()), this, SLOT(ReadFile()));
123   connect(savebutton, SIGNAL(pressed()), this, SLOT(SaveFile()));
124 }
125 //------------------------------------------------------------------------------
126
127 //------------------------------------------------------------------------------
128 void vvToolRigidReg::apply()
129 {
130  QMessageBox mb( "Keep Overlay",
131                     "Do you want to keep the overlay on?\n"
132                     "You can switch it off anytime by pressing 'x'",
133                     QMessageBox::Information,
134                     QMessageBox::Yes | QMessageBox::Default,
135                     QMessageBox::No,
136                     QMessageBox::Cancel | QMessageBox::Escape );
137     mb.setButtonText( QMessageBox::Yes, "Yes" );
138     mb.setButtonText( QMessageBox::No, "No" );
139     switch( mb.exec() ) {
140         case QMessageBox::Yes:
141           hide();
142           break;
143         case QMessageBox::No:
144          mInput2->Reload();
145          mInput2->Render();
146          mInput1->Reload(); 
147          mInput1->Render();
148          for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers();i++)
149          {
150            mInput1->RemoveActor("overlay",0);
151            mInput1->SetColorMap(0);
152            mInput1->Render();
153            hide();
154          }
155          break;
156         case QMessageBox::Cancel:
157             break;
158     }
159 }
160 //------------------------------------------------------------------------------
161
162 //------------------------------------------------------------------------------
163 void vvToolRigidReg::SetOverlay()
164 {
165     for (int i =0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
166    mCurrentSlicerManager->GetSlicer(i)->SetOverlay(mInput2->GetImage());
167    mCurrentSlicerManager->GetSlicer(i)->SetActorVisibility("overlay",0,true);   
168    mCurrentSlicerManager->SetColorMap();
169    mCurrentSlicerManager->Render();
170    }
171   }
172 //------------------------------------------------------------------------------
173
174 //------------------------------------------------------------------------------
175 void vvToolRigidReg::SetXvalue()
176 {
177   QString xstr = Xval->text();
178 }
179 //------------------------------------------------------------------------------
180
181 //------------------------------------------------------------------------------
182 void vvToolRigidReg::SetYvalue()
183 {
184   QString ystr = Yval->text();
185 }
186 //------------------------------------------------------------------------------
187
188 //------------------------------------------------------------------------------
189 void vvToolRigidReg::SetZvalue()
190 {
191   QString zstr = Zval->text();
192 }
193 //------------------------------------------------------------------------------
194
195 //------------------------------------------------------------------------------
196 void vvToolRigidReg::SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ,bool update)
197 {
198    
199   vtkSmartPointer<vtkTransform> transform = mCurrentSlicerManager->GetImage()->GetTransform();
200   transform->PostMultiply();
201   //Rotations
202   if (aX!=0 || aY!=0 || aZ!=0) {
203     double x, y ,z;
204     x= Xval->text().toDouble();
205     y= Yval->text().toDouble();
206     z= Zval->text().toDouble();
207     transform->Translate(-x,-y,-z);
208     if (aX!=0) transform->RotateX(aX);
209     if (aY!=0) transform->RotateY(aY);
210     if (aZ!=0) transform->RotateZ(aZ);
211     transform->Translate(x,y,z);
212   }
213   //Translations
214   if (tX!=0||tY!=0||tZ!=0)
215     transform->Translate(tX*mInput1->GetImage()->GetSpacing()[0],tY*mInput1->GetImage()->GetSpacing()[1],tZ*mInput1->GetImage()->GetSpacing()[2]);
216
217     transform->Update();
218   if(update)
219   {
220     for (int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
221       mCurrentSlicerManager->GetImage()->UpdateReslice();
222       mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
223       mCurrentSlicerManager->GetSlicer(i)->Render();
224     }
225   }
226 }
227 //------------------------------------------------------------------------------
228
229 //------------------------------------------------------------------------------
230 void vvToolRigidReg::SetTransform(vtkMatrix4x4 *matrix)
231 {
232     vtkSmartPointer<vtkTransform> transform =mCurrentSlicerManager->GetImage()->GetTransform();
233     transform->SetMatrix(matrix);
234     transform->PostMultiply();
235     transform->Concatenate(matrix);
236     transform->Update();
237     mCurrentSlicerManager->GetImage()->SetTransform(transform);
238    
239     for (int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
240       mCurrentSlicerManager->GetImage()->UpdateReslice();
241       mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
242       mCurrentSlicerManager->GetSlicer(i)->Render();
243       }
244 }
245 //------------------------------------------------------------------------------
246
247 //------------------------------------------------------------------------------
248   void vvToolRigidReg::UpdateTextEditor(vtkMatrix4x4 *matrix)
249 {
250    QString str1,str2,str3;
251     QColor color;
252     textEdit->clear();
253     textEdit->setAcceptRichText(true);
254
255     str2=textEdit->toPlainText();
256     str2.append("Rotation Center(mm): \n");
257     textEdit->setText(str2);
258     
259     str2=textEdit->toPlainText();
260     textEdit->setTextColor(QColor(255,0,0));
261     str2.append(str3.append(Xval->text()));
262     textEdit->setText(str2);
263     str3.clear();
264
265     str2=textEdit->toPlainText();
266     str2.append("\t");
267     textEdit->setText(str2);
268
269     str2=textEdit->toPlainText();
270     str2.append(str3.append(Yval->text()));
271     textEdit->setText(str2);
272     str3.clear();
273     
274     str2=textEdit->toPlainText();
275     str2.append("\t");
276     textEdit->setText(str2);
277     
278
279     str2=textEdit->toPlainText();
280     str2.append(str3.append(Zval->text()));
281     textEdit->setText(str2);
282
283
284     str2=textEdit->toPlainText();
285     str2.append("\n");
286     textEdit->setText(str2);
287     
288
289     str2=textEdit->toPlainText();
290     str2.append("Transformation Matrix(mm):\n");
291     textEdit->setText(str2);
292
293     for(int i=0;i<4;i++)
294     {
295     for(int j=0;j<4;j++)
296       {
297     str2=textEdit->toPlainText();
298    // str2.append("\t"+str1.setNum(matrix->Element[i][j]));
299     str2.append(QString("%1\t").arg(str1.setNum(matrix->Element[i][j]),20));  
300     textEdit->setText(str2);
301       }
302     str2=textEdit->toPlainText();
303     str2.append("\n");  
304     textEdit->setText(str2);
305     }
306     //QString str = QFileDialog::getOpenFileName();
307     textEdit->setTextColor(QColor(255,0,0));
308     textEdit->setFont(QFont("courrier new",12,4,true));
309     textEdit->toPlainText().toAscii();
310     
311     str2=textEdit->toPlainText();
312     textEdit->setText(str2);
313 }
314 //------------------------------------------------------------------------------
315
316 //------------------------------------------------------------------------------
317 void vvToolRigidReg::UpdateXtransb()
318 {
319   int diff=0;
320   diff=xtrans_sb->value()-xtrans_slider->value();
321   this->SetTransform(diff, 0, 0, 0, 0, 0,true);
322   xtrans_slider->setValue(xtrans_sb->value());
323    UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
324     
325 }
326 //------------------------------------------------------------------------------
327
328 //------------------------------------------------------------------------------
329 void vvToolRigidReg::UpdateXtranslider()
330 {
331   int diff=0;
332   diff=xtrans_slider->value()-xtrans_sb->value();
333   this->SetTransform(diff, 0, 0, 0, 0, 0,true);
334   xtrans_sb->setValue(xtrans_slider->value());
335   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
336 }
337 //------------------------------------------------------------------------------
338
339 //------------------------------------------------------------------------------
340 void vvToolRigidReg::UpdateYtransb()
341 {
342
343   int diff=0;
344   diff=ytrans_sb->value()-ytrans_slider->value();
345   this->SetTransform(0, diff, 0, 0, 0, 0,true);
346   ytrans_slider->setValue(ytrans_sb->value());
347  UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
348 }
349
350 //------------------------------------------------------------------------------
351
352 //------------------------------------------------------------------------------
353 void vvToolRigidReg::UpdateYtranslider()
354 {
355   int diff=0;
356   diff=ytrans_slider->value()-ytrans_sb->value();
357   this->SetTransform(0, diff, 0, 0, 0, 0,true);
358   ytrans_sb->setValue(ytrans_slider->value());
359   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
360 }
361 //------------------------------------------------------------------------------
362
363 //------------------------------------------------------------------------------
364 void vvToolRigidReg::UpdateZtransb()
365 {
366
367   int diff=0;
368   diff=ztrans_sb->value()-ztrans_slider->value();
369   this->SetTransform(0, 0, diff, 0, 0, 0,true);
370   ztrans_slider->setValue(ztrans_sb->value());
371    UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
372 }
373
374 //------------------------------------------------------------------------------
375
376 //------------------------------------------------------------------------------
377 void vvToolRigidReg::UpdateZtranslider()
378 {
379   int diff=0;
380   diff=ztrans_slider->value()-ztrans_sb->value();
381   this->SetTransform(0, 0, diff, 0, 0, 0,true);
382   ztrans_sb->setValue(ztrans_slider->value());
383   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
384 }
385 //------------------------------------------------------------------------------
386
387 //------------------------------------------------------------------------------
388 void vvToolRigidReg::UpdateXrotsb()
389 {
390
391   int diff=0;
392   diff=xrot_sb->value()-xrot_slider->value();
393   this->SetTransform(0, 0, 0, diff, 0, 0,true);
394   xrot_slider->setValue(xrot_sb->value());
395   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
396 }
397
398 //------------------------------------------------------------------------------
399
400 //------------------------------------------------------------------------------
401 void vvToolRigidReg::UpdateXrotslider()
402 {
403   int diff=0;
404   diff=xrot_slider->value()-xrot_sb->value();
405   this->SetTransform(0, 0, 0, diff, 0, 0,true);
406   xrot_sb->setValue(xrot_slider->value());
407   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
408 }
409 //------------------------------------------------------------------------------
410
411 //------------------------------------------------------------------------------
412 void vvToolRigidReg::UpdateYrotsb()
413 {
414
415   int diff=0;
416   diff=yrot_sb->value()-yrot_slider->value();
417   this->SetTransform(0, 0, 0, 0, diff, 0,true);
418   yrot_slider->setValue(yrot_sb->value());
419   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
420 }
421
422 //------------------------------------------------------------------------------
423
424 //------------------------------------------------------------------------------
425 void vvToolRigidReg::UpdateYrotslider()
426 {
427   int diff=0;
428   diff=yrot_slider->value()-yrot_sb->value();
429   this->SetTransform(0, 0, 0, 0, diff, 0,true);
430   yrot_sb->setValue(yrot_slider->value());
431   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
432 }
433 //------------------------------------------------------------------------------
434
435 //------------------------------------------------------------------------------
436 void vvToolRigidReg::UpdateZrotsb()
437 {
438
439   int diff=0;
440   diff=zrot_sb->value()-zrot_slider->value();
441   this->SetTransform(0, 0, 0, 0, 0,diff,true);
442   zrot_slider->setValue(zrot_sb->value());
443   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
444 }
445
446 //------------------------------------------------------------------------------
447
448 //------------------------------------------------------------------------------
449 void vvToolRigidReg::UpdateZrotslider()
450 {
451   int diff=0;
452   diff=zrot_slider->value()-zrot_sb->value();
453   this->SetTransform(0, 0, 0, 0, 0, diff,true);
454   zrot_sb->setValue(zrot_slider->value());
455   UpdateTextEditor(mCurrentSlicerManager->GetImage()->GetTransform()->GetMatrix());
456 }
457 //------------------------------------------------------------------------------
458
459 //------------------------------------------------------------------------------
460 void vvToolRigidReg::SaveFile()
461 {       
462    QString s = QFileDialog::getSaveFileName(this, tr("Save File"),
463                             "/home",
464                             tr("Text (*.txt *.doc *.rtf)"));
465     QFile file(s);
466     if (file.open(QFile::WriteOnly | QFile::Truncate)) {
467     QTextStream out(&file);
468     out<<textEdit->toPlainText() ;
469     }
470 }
471 //------------------------------------------------------------------------------
472
473 //------------------------------------------------------------------------------
474 void vvToolRigidReg::ReadFile()
475 {
476   vtkMatrix4x4 *matrix=vtkMatrix4x4::New();
477    vtkSmartPointer<vtkTransform> transform = mCurrentSlicerManager->GetImage()->GetTransform();
478    QString s = QFileDialog::getOpenFileName(
479                     this,
480                     "Choose a file",
481                     "/home",
482                     "Text (*.txt *.rtf *.doc)");
483     if (s.isEmpty())
484     return;
485     
486    QFile file(s);
487    ifstream readfile;
488    std::string x= s.toStdString();
489    std::vector<QString> Qstr;
490    readfile.open(x.c_str());
491    if (readfile.is_open()) 
492    {
493     while (!readfile.eof())
494       {
495       readfile >> x;
496       Qstr.push_back(QString(x.c_str()));
497       }
498       readfile.close();
499    }
500     else {
501       cout << "Unable to open file";
502     }
503     //Set the transformation matrix
504     int index =7;
505    for(int i=0;i<4;i++)
506    {
507      for(int j=0;j<4;j++)
508      {
509        matrix->Element[i][j]=Qstr.at(index).toDouble();
510        index++;
511      }
512    }
513    transform->SetMatrix(matrix);
514    // SetTransform(matrix);
515     double * orientations=new double[3];
516     double * translations=new double[3];
517     transform->GetOrientation(orientations);
518     transform->PostMultiply();
519     
520        //Obtain the Rotation Center 
521     Xval->setText(Qstr.at(2));
522     Yval->setText(Qstr.at(3));
523     Zval->setText(Qstr.at(4));
524  
525     //In the Order or Y X Z //
526     //now  postmultiply for the rotations 
527      SetTransform(0,0,0,0,0,-orientations[2],false);
528      SetTransform(0,0,0,-orientations[0],0,0,false);
529      SetTransform(0,0,0,0,-orientations[1],0,false);
530       
531     transform->GetPosition(translations);
532     transform->Identity();      
533  
534   /*  DD(translations[0]/mInput1->GetImage()->GetSpacing()[0]);
535     DD(translations[1]/mInput1->GetImage()->GetSpacing()[1]);
536     DD(translations[2]/mInput1->GetImage()->GetSpacing()[2]);
537     DD(orientations[0]);
538     DD(orientations[1]);
539     DD(orientations[2]);*/
540   //set the sliders  and spin box values 
541     xtrans_slider->setValue(rint(translations[0]/mInput1->GetImage()->GetSpacing()[0]));
542     UpdateXtranslider();
543     ytrans_slider->setValue(rint(translations[1]/mInput1->GetImage()->GetSpacing()[1]));
544     UpdateYtranslider();        
545     ztrans_slider->setValue(rint(translations[2]/mInput1->GetImage()->GetSpacing()[2]));
546     UpdateZtranslider();
547     yrot_slider->setValue(rint(orientations[1]));
548     UpdateYrotslider();
549     xrot_slider->setValue(rint(orientations[0]));
550     UpdateXrotslider(); 
551     zrot_slider->setValue(rint(orientations[2]));
552     UpdateZrotslider();
553 }
554 //------------------------------------------------------------------------------
555
556 //------------------------------------------------------------------------------
557 void vvToolRigidReg::ResetTransform()
558 {
559   vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
560    matrix->Identity();
561    mInput1->Reload();
562    mInput1->Render();
563    mInput2->Reload();
564    mInput2->Render(); 
565    SetRotationCenter();
566    SetSliderRanges();
567    SetTransform(matrix);
568    UpdateTextEditor(matrix);
569 }
570 //------------------------------------------------------------------------------
571
572 //------------------------------------------------------------------------------
573 void vvToolRigidReg::SetRotationCenter()
574 {
575     //default image rotation center is the center of the image
576     QString xcord,ycord,zcord;
577     std::vector<double> imageorigin;
578     imageorigin=mInput1->GetImage()->GetOrigin();
579     
580     xcord=xcord.setNum(imageorigin[0]+mImageSize[0]*mInput1->GetImage()->GetSpacing()[0]/2, 'g', 3);
581     ycord=ycord.setNum(imageorigin[1]+mImageSize[1]*mInput1->GetImage()->GetSpacing()[1]/2, 'g', 3);
582     zcord=zcord.setNum(imageorigin[2]+mImageSize[2]*mInput1->GetImage()->GetSpacing()[2]/2, 'g', 3);
583
584     Xval->setText(xcord);
585     Yval->setText(ycord);
586     Zval->setText(zcord);
587     InitializeSliders();
588 }
589 //------------------------------------------------------------------------------
590
591 //------------------------------------------------------------------------------
592 void vvToolRigidReg::InitializeSliders()
593 {
594      xtrans_slider->signalsBlocked();
595      ytrans_slider->signalsBlocked();
596      ztrans_slider->signalsBlocked();
597      xtrans_sb->signalsBlocked();
598      ytrans_sb->signalsBlocked();
599      ztrans_sb->signalsBlocked();
600      xrot_slider->signalsBlocked();
601      yrot_slider->signalsBlocked();
602      zrot_slider->signalsBlocked();
603      xrot_sb->signalsBlocked();
604      yrot_sb->signalsBlocked();
605      zrot_sb->signalsBlocked();
606      
607     xtrans_sb->setValue(0);
608     ytrans_sb->setValue(0);
609     ztrans_sb->setValue(0);
610     
611     xtrans_slider->setValue(0);
612     ytrans_slider->setValue(0);
613     ztrans_slider->setValue(0);
614     
615     xrot_sb->setValue(0);
616     yrot_sb->setValue(0);
617     zrot_sb->setValue(0);
618
619     xrot_slider->setValue(0);
620     yrot_slider->setValue(0);
621     zrot_slider->setValue(0);
622 }
623 //------------------------------------------------------------------------------
624
625 //------------------------------------------------------------------------------
626 void vvToolRigidReg::SetSliderRanges()
627 {
628   xtrans_slider->setMaximum(1000);
629   xtrans_slider->setMinimum(-1000);
630   ytrans_slider->setMaximum(1000);
631   ytrans_slider->setMinimum(-1000);
632   ztrans_slider->setMaximum(1000);
633   ztrans_slider->setMinimum(-1000);
634
635   xtrans_sb->setMaximum(1000);
636   xtrans_sb->setMinimum(-1000);
637   ytrans_sb->setMaximum(1000);
638   ytrans_sb->setMinimum(-1000);
639   ztrans_sb->setMaximum(1000);
640   ztrans_sb->setMinimum(-1000);
641
642   xrot_slider->setMaximum(360);
643   xrot_slider->setMinimum(-360);
644   yrot_slider->setMaximum(360);
645   yrot_slider->setMinimum(-360);
646   zrot_slider->setMaximum(360);
647   zrot_slider->setMinimum(-360);
648
649   xrot_sb->setMaximum(360);
650   xrot_sb->setMinimum(-360);
651   yrot_sb->setMaximum(360);
652   yrot_sb->setMinimum(-360);
653   zrot_sb->setMaximum(360);
654   zrot_sb->setMinimum(-360);
655 }