]> Creatis software - clitk.git/blob - vv/vvToolProfile.h
Merge branch 'VTK6_Qt5' into VTK6_Qt5_LineProfile
[clitk.git] / vv / vvToolProfile.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://www.centreleonberard.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 VVTOOLPROFILE_H
19 #define VVTOOLPROFILE_H
20
21 #if QT_VERSION < 0x050000
22 #include <QtDesigner/QDesignerExportWidget>
23 #else
24 #include <QtUiPlugin/QDesignerExportWidget>
25 #endif
26
27 #include "vvToolBase.h"
28 #include "vvToolWidgetBase.h"
29 #include "vvImageContour.h"
30 #include "vvLandmarks.h"
31 #include "ui_vvToolProfile.h"
32 #include "vvBinaryImageOverlayActor.h"
33
34 #include "clitkProfileImage_ggo.h"
35 #include "clitkProfileImageGenericFilter.h"
36 #include <vtkTable.h>
37 #include <vtkContextView.h>
38 #include <vtkContextScene.h>
39
40 //------------------------------------------------------------------------------
41 class vvToolProfile:
42   public vvToolWidgetBase,
43   public vvToolBase<vvToolProfile>, 
44   private Ui::vvToolProfile
45 {
46   Q_OBJECT
47     public:
48   vvToolProfile(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
49   ~vvToolProfile();
50
51   //-----------------------------------------------------
52   static void Initialize();
53   void InitializeLine();
54   void GetArgsInfoFromGUI();
55   virtual void InputIsSelected(vvSlicerManager * m);
56
57   bool isPointsSelected();
58   void computeProfile();
59   void SetPoints();
60
61   //-----------------------------------------------------
62   public slots:
63   virtual void apply();
64   virtual bool close();
65   virtual void reject();
66   
67   void selectPoint1();
68   void selectPoint2();
69   void cancelPoints();
70   void SaveAs();
71   void DisplayLine(int);
72   void DeleteLine(int);
73
74  protected:
75   void RemoveVTKObjects();
76   virtual void closeEvent(QCloseEvent *event);
77   Ui::vvToolProfile ui;
78   args_info_clitkProfileImage mArgsInfo;
79   
80   int* mPoint1;
81   int* mPoint2;
82   bool mPoint1Selected;
83   bool mPoint2Selected;
84   vtkSmartPointer<vtkContextView> mView;
85   clitk::ProfileImageGenericFilter::Pointer mFilter;
86   std::string mTextFileName;
87   std::vector<vtkSmartPointer<vtkActor> > mLineActors;
88   vtkSmartPointer<vtkPolyData> mLinesPolyData;
89
90
91 }; // end class vvToolProfile
92 //------------------------------------------------------------------------------
93
94 #endif
95