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