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