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