]> Creatis software - clitk.git/blob - vv/vvToolBinarize.h
- binarize tool
[clitk.git] / vv / vvToolBinarize.h
1 /*=========================================================================
2
3   Program:   vv
4   Module:    $RCSfile: vvToolBinarize.h,v $
5   Language:  C++
6   Date:      $Date: 2010/01/29 13:54:37 $
7   Version:   $Revision: 1.1 $
8   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
9
10   Copyright (C) 2010
11   Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
12   CREATIS                   http://www.creatis.insa-lyon.fr
13
14   This program is free software: you can redistribute it and/or modify
15   it under the terms of the GNU General Public License as published by
16   the Free Software Foundation, version 3 of the License.
17
18   This program is distributed in the hope that it will be useful,
19   but WITHOUT ANY WARRANTY; without even the implied warranty of
20   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21   GNU General Public License for more details.
22
23   You should have received a copy of the GNU General Public License
24   along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
26   =========================================================================*/
27
28 #ifndef VVTOOLBINARIZE_H
29 #define VVTOOLBINARIZE_H
30
31 #include <QtDesigner/QDesignerExportWidget>
32 #include <QDialog>
33
34 #include "vvToolBase.h"
35 #include "ui_vvToolBinarize.h"
36 #include "clitkBinarizeImage_ggo.h"
37
38 #include "vtkMarchingSquares.h"
39 #include "vtkImageClip.h"
40 #include "vtkMarchingCubes.h"
41 #include "vtkPolyData.h"
42 #include "vtkPolyDataMapper.h"
43 #include "vtkActor.h"
44 #include "vtkProperty.h"
45 #include "vtkRenderer.h"
46
47 //------------------------------------------------------------------------------
48 class QDESIGNER_WIDGET_EXPORT vvToolBinarize: 
49   public QDialog, public vvToolBase<vvToolBinarize>, private Ui::vvToolBinarize 
50 {
51   Q_OBJECT
52     public:
53   vvToolBinarize(QWidget * parent=0, Qt::WindowFlags f=0);
54   ~vvToolBinarize();
55
56   //-----------------------------------------------------
57   typedef vvToolBinarize Self;
58
59   //-----------------------------------------------------
60   static void Initialize() {
61     SetToolName("Binarize");
62     SetToolMenuName("Binarize");
63     SetToolIconFilename(":/new/prefix1/icons/binarize.png");
64     SetToolTip("Image interactive binarization with thresholds.");
65   }
66
67   void InputIsSet(bool b);
68   void GetArgsInfoFromGUI();
69
70   //-----------------------------------------------------
71  // public slots:
72 //   void InputUpdate();
73
74   public slots:
75   void apply();
76   // void InputChange(int index);
77   void valueChangedT1(double v);
78   void valueChangedT2(double v);
79   void UpdateSlice(int slicer,int slices);
80   void InputIsSelected();
81   void enableLowerThan(bool b);
82
83  protected:
84   Ui::vvToolBinarize ui;
85   // std::vector<vvSlicerManager*> mSlicerManagers;
86 //   std::vector<vvSlicerManager*> mSlicerManagersCompatible;
87 //   vvImage::Pointer mCurrentImage;
88 //   vvSlicerManager * mCurrentSliceManager;
89   args_info_clitkBinarizeImage mArgsInfo;
90
91   vtkImageClip* mClipper;
92   vtkMarchingSquares* mSquares1;
93   vtkPolyDataMapper* mSquaresMapper1;
94   vtkActor* mSquaresActor1;
95
96 }; // end class vvToolBinarize
97 //------------------------------------------------------------------------------
98
99 #endif
100