]> Creatis software - clitk.git/blob - vv/vvToolHistogram.h
Add window/level lines in histogram tool
[clitk.git] / vv / vvToolHistogram.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 VVTOOLHISTOGRAM_H
19 #define VVTOOLHISTOGRAM_H
20
21 #include <QtGlobal>
22 #include <QtDesigner/QDesignerExportWidget>
23
24 #include "vvToolBase.h"
25 #include "vvToolWidgetBase.h"
26 #include "ui_vvToolHistogram.h"
27
28 #include "clitkHistogramImage_ggo.h"
29 #include "clitkHistogramImageGenericFilter.h"
30 #include <vtkTable.h>
31 #include <vtkContextView.h>
32 #include <vtkContextScene.h>
33
34 //------------------------------------------------------------------------------
35 class vvToolHistogram:
36   public vvToolWidgetBase,
37   public vvToolBase<vvToolHistogram>, 
38   private Ui::vvToolHistogram
39 {
40   Q_OBJECT
41     public:
42   vvToolHistogram(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
43   ~vvToolHistogram();
44
45   //-----------------------------------------------------
46   static void Initialize();
47   void GetArgsInfoFromGUI();
48   virtual void InputIsSelected(vvSlicerManager * m);
49
50   void computeHistogram();
51   void changeWindowLevel();
52   void computeWindowLevel();
53   void computeMinMax();
54   void SetPoints();
55
56   //-----------------------------------------------------
57   public slots:
58   virtual void apply();
59   virtual bool close();
60   virtual void reject();
61   virtual void windowLevelChanged();
62
63   void SaveAs();
64
65  protected:
66   void RemoveVTKObjects();
67   virtual void closeEvent(QCloseEvent *event);
68   Ui::vvToolHistogram ui;
69   args_info_clitkHistogramImage mArgsInfo;
70
71   double mMinWindowLevel;
72   double mMaxWindowLevel;
73
74   vtkSmartPointer<vtkContextView> mView;
75   clitk::HistogramImageGenericFilter::Pointer mFilter;
76   std::string mTextFileName;
77
78 }; // end class vvToolHistogram
79 //------------------------------------------------------------------------------
80
81 #endif
82