]> Creatis software - clitk.git/blob - vv/vvToolRigidReg.h
Added functionalitites to Reset, save and view transformations etc..
[clitk.git] / vv / vvToolRigidReg.h
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 #ifndef VVTOOLRIGIDREG_H
19 #define VVTOOLRIGIDREG_H
20 #include <QtDesigner/QDesignerExportWidget>
21 #include <QDialog>
22
23 #include "vvToolBase.h"
24 #include "vvToolWidgetBase.h"
25 #include "vvMainWindowBase.h"
26 #include "vvMainWindow.h"
27 #include "ui_vvToolRigidReg.h"
28 #include "vtkMatrix4x4.h"
29
30 //------------------------------------------------------------------------------
31 class vvToolRigidReg:
32     public vvToolWidgetBase,
33     public vvToolBase<vvToolRigidReg>,
34     private Ui::vvToolRigidReg
35 {
36   Q_OBJECT
37 public:
38   vvToolRigidReg(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
39   ~vvToolRigidReg();
40   virtual void InputIsSelected(std::vector<vvSlicerManager *> & m);
41 public slots:
42   virtual void apply();
43   virtual bool close();
44   virtual void reject();
45   //-----------------------------------------------------
46   static void Initialize() {
47     SetToolName("Register");
48     SetToolMenuName("Register");
49     SetToolIconFilename(":/common/icons/register.png");
50     SetToolTip("Register Image.");
51     SetToolExperimental(true);
52   }
53   void SetXvalue();
54   void SetYvalue();
55   void SetZvalue();
56   void SetOrderXtrans();
57   void SetOrderYtrans();
58   void SetOrderZtrans();
59   void SetOrderXrot();
60   void SetOrderYrot();
61   void SetOrderZrot();
62   void UpdateXtranslider();
63   void UpdateXtransb();
64   void UpdateYtranslider();
65   void UpdateYtransb();
66   void UpdateZtranslider();
67   void UpdateZtransb();
68   void UpdateXrotslider();
69   void UpdateXrotsb();
70   void UpdateYrotslider();
71   void UpdateYrotsb(); 
72   void UpdateZrotslider();
73   void UpdateZrotsb();  
74   void SetOverlay();
75   void SaveFile();
76   void ReadFile();
77   void ResetTransform();
78   void SetRotationCenter();
79   void SetSliderRanges();
80   void UpdateTextEditor(vtkMatrix4x4 *matrix,QString SetOrder);
81   void InitializeSliders();
82   
83   protected:
84   Ui::vvToolRigidReg ui;
85   vvSlicerManager * mInput1;
86   vvSlicerManager * mInput2;
87   vvMainWindow * mWindow;
88   QString mOrder;
89   bool mTwoInputs;
90   std::vector<int> mImageSize;
91   void SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ);
92   void SetTransform(vtkMatrix4x4 * matrix);
93 }; // end class vvToolRigidReg
94 //------------------------------------------------------------------------------
95
96 #endif
97