1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
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
22 #if QT_VERSION >= 0x050000
23 #include <QtUiPlugin/QDesignerExportWidget>
25 #include <QtDesigner/QDesignerExportWidget>
28 #include "vvToolBase.h"
29 #include "vvToolWidgetBase.h"
30 #include "ui_vvToolHistogram.h"
32 #include "clitkHistogramImage_ggo.h"
33 #include "clitkHistogramImageGenericFilter.h"
35 #include <vtkContextView.h>
36 #include <vtkContextScene.h>
37 #include <vtkInteractorObserver.h>
38 #include <vtkEventQtSlotConnect.h>
40 //------------------------------------------------------------------------------
41 class vvToolHistogram:
42 public vvToolWidgetBase,
43 public vvToolBase<vvToolHistogram>,
44 private Ui::vvToolHistogram
48 vvToolHistogram(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
51 //-----------------------------------------------------
52 static void Initialize();
53 void GetArgsInfoFromGUI();
54 virtual void InputIsSelected(vvSlicerManager * m);
56 void computeHistogram();
57 void changeWindowLevel();
58 void computeWindowLevel();
62 void displayHistogram();
64 QVTKWidget* GetHistogramWidget();
66 //-----------------------------------------------------
70 virtual void reject();
72 void windowLevelChanged();
75 void translateWindow(double x);
80 void RemoveVTKObjects();
81 virtual void closeEvent(QCloseEvent *event);
82 Ui::vvToolHistogram ui;
83 args_info_clitkHistogramImage mArgsInfo;
85 double mMinWindowLevel;
86 double mMaxWindowLevel;
87 double originalWindow;
89 bool mModificationsDone;
91 vtkSmartPointer<vtkContextView> mView;
93 vtkSmartPointer<vtkTable> mTableWindowLevel;
94 vtkSmartPointer<vtkTable> mTable;
95 //vtkSmartPointer<vtkContextView> mView;
96 clitk::HistogramImageGenericFilter::Pointer mFilter;
97 std::string mTextFileName;
99 }; // end class vvToolHistogram
100 //------------------------------------------------------------------------------