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