]> Creatis software - clitk.git/blob - vv/vvToolRigidReg.h
Added Presets, GUI for metric, interp, etc.for AutoReg.
[clitk.git] / vv / vvToolRigidReg.h
1
2 /*=========================================================================
3   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
4
5   Authors belong to:
6   - University of LYON              http://www.universite-lyon.fr/
7   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
8   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
9
10   This software is distributed WITHOUT ANY WARRANTY; without even
11   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12   PURPOSE.  See the copyright notices for more information.
13
14   It is distributed under dual licence
15
16   - BSD        See included LICENSE.txt file
17   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
18 ======================================================================-====*/
19 #ifndef VVTOOLRIGIDREG_H
20 #define VVTOOLRIGIDREG_H
21 #include <QtDesigner/QDesignerExportWidget>
22 #include <QDialog>
23
24 #include "vvToolBase.h"
25 #include "vvToolWidgetBase.h"
26 #include "vvMainWindowBase.h"
27 #include "vvMainWindow.h"
28 #include "ui_vvToolRigidReg.h"
29 #include "vtkMatrix4x4.h"
30 #include "clitkAffineRegistration_ggo.h"
31
32 //------------------------------------------------------------------------------
33 class vvToolRigidReg:
34     public vvToolWidgetBase,
35     public vvToolBase<vvToolRigidReg>,
36     private Ui::vvToolRigidReg
37 {
38   Q_OBJECT
39 public:
40   vvToolRigidReg(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
41   ~vvToolRigidReg();
42   virtual void InputIsSelected(std::vector<vvSlicerManager *> & m);
43 public slots:
44   virtual void apply();
45   virtual bool close();
46   virtual void reject();
47   //-----------------------------------------------------
48   static void Initialize() {
49     SetToolName("Register");
50     SetToolMenuName("Register");
51     SetToolIconFilename(":/common/icons/register.png");
52     SetToolTip("Register Image.");
53     SetToolExperimental(true);
54   }
55   virtual void GetArgsInfoFromGUI();
56   void SetOverlay(vvImage::Pointer Image);
57   void RemoveOverlay();
58   void SetXvalue();
59   void SetYvalue();
60   void SetZvalue();
61   void Render();
62   void UpdateTextEditor(vtkMatrix4x4 *matrix,QTextEdit *textEdit);
63   void UpdateTransform_sliders();
64   void UpdateTransform_sb();
65   void UpdateTransform(bool slider_enabled);  
66   void AutoRegister();
67   void SaveFile();
68   void ReadFile(bool matrix_given);
69   void LoadFile();
70   void ResetTransform();
71   void SetRotationCenter();
72   void SetSliderRanges();
73   void InitializeSliders(double xtrans,double ytrans, double ztrans, double xrot, double yrot, double zrot,bool sliders);
74   void TransformSelect();
75   void OptimizerSelect();
76   void InterpolatorSelect();
77   void MetricSelect();
78   void OutputSelect();
79   void SaveTextEdit();
80   void CmdlineParser(int override, int initialize);
81   void Presets();
82   void UpdateTextEditor2();
83   protected:
84   Ui::vvToolRigidReg ui;
85   vvSlicerManager * mInput1;
86   vvSlicerManager * mInput2;
87   vvMainWindow * mWindow;
88   std::string mConfigFile;
89   bool mTwoInputs;
90   std::vector<int> mImageSize;
91   args_info_clitkAffineRegistration mArgsInfo;
92   double mInitialMatrix[16];
93   void SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ,bool update);
94   void SetTransform(vtkMatrix4x4 * matrix);
95 }; // end class vvToolRigidReg
96 //------------------------------------------------------------------------------
97
98 #endif
99