]> Creatis software - clitk.git/blob - vv/vvToolRigidReg.h
Loaded Initial Transform functionality
[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 #include "clitkAffineRegistration_ggo.h"
30
31 //------------------------------------------------------------------------------
32 class vvToolRigidReg:
33     public vvToolWidgetBase,
34     public vvToolBase<vvToolRigidReg>,
35     private Ui::vvToolRigidReg
36 {
37   Q_OBJECT
38 public:
39   vvToolRigidReg(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
40   ~vvToolRigidReg();
41   virtual void InputIsSelected(std::vector<vvSlicerManager *> & m);
42 public slots:
43   virtual void apply();
44   virtual bool close();
45   virtual void reject();
46   //-----------------------------------------------------
47   static void Initialize() {
48     SetToolName("Register");
49     SetToolMenuName("Register");
50     SetToolIconFilename(":/common/icons/register.png");
51     SetToolTip("Register Image.");
52     SetToolExperimental(true);
53   }
54   virtual void GetArgsInfoFromGUI();
55   void SetOverlay();
56   void RemoveOverlay();
57   void SetXvalue();
58   void SetYvalue();
59   void SetZvalue();
60   void Render();
61   void UpdateTextEditor(vtkMatrix4x4 *matrix,QTextEdit *textEdit);
62   void UpdateTransform_sliders();
63   void UpdateTransform_sb();
64   void UpdateTransform(bool slider_enabled);  
65   void AutoRegister();
66   void SaveFile();
67   void ReadFile();
68   void ResetTransform();
69   void SetRotationCenter();
70   void SetSliderRanges();
71   void InitializeSliders(double xtrans,double ytrans, double ztrans, double xrot, double yrot, double zrot,bool sliders);
72   protected:
73   Ui::vvToolRigidReg ui;
74   vvSlicerManager * mInput1;
75   vvSlicerManager * mInput2;
76   vvMainWindow * mWindow;
77   bool mTwoInputs;
78   std::vector<int> mImageSize;
79   args_info_clitkAffineRegistration mArgsInfo;
80   double mInitialMatrix[16];
81   void SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ,bool update);
82   void SetTransform(vtkMatrix4x4 * matrix);
83 }; // end class vvToolRigidReg
84 //------------------------------------------------------------------------------
85
86 #endif
87