2 /*=========================================================================
3 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
14 It is distributed under dual licence
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>
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"
32 //------------------------------------------------------------------------------
34 public vvToolWidgetBase,
35 public vvToolBase<vvToolRigidReg>,
36 private Ui::vvToolRigidReg
40 vvToolRigidReg(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
42 virtual void InputIsSelected(std::vector<vvSlicerManager *> & m);
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);
55 virtual void GetArgsInfoFromGUI();
56 void SetOverlay(vvImage::Pointer Image);
62 void UpdateTextEditor(vtkMatrix4x4 *matrix,QTextEdit *textEdit);
63 void UpdateTransform_sliders();
64 void UpdateTransform_sb();
65 void UpdateTransform(bool slider_enabled);
68 void ReadFile(bool matrix_given);
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();
80 void CmdlineParser(int override, int initialize);
82 void UpdateTextEditor2();
83 void CheckRigidReg(); //Deformable or Rigid
84 void CheckDeformableReg();
86 Ui::vvToolRigidReg ui;
87 vvSlicerManager * mInput1;
88 vvSlicerManager * mInput2;
89 vvMainWindow * mWindow;
90 std::string mConfigFile;
92 std::vector<int> mImageSize;
93 args_info_clitkAffineRegistration mArgsInfo;
94 double mInitialMatrix[16];
95 void SetTransform(double tX, double tY, double tZ, double aX, double aY, double aZ,bool update);
96 void SetTransform(vtkMatrix4x4 * matrix);
97 }; // end class vvToolRigidReg
98 //------------------------------------------------------------------------------