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