]> Creatis software - clitk.git/blob - vv/vvToolBinarize.h
binarize
[clitk.git] / vv / vvToolBinarize.h
1 /*=========================================================================
2
3   Program:   vv
4   Module:    $RCSfile: vvToolBinarize.h,v $
5   Language:  C++
6   Date:      $Date: 2010/02/06 15:38:14 $
7   Version:   $Revision: 1.3 $
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 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   void useFGBGtoggled(bool);
83
84  protected:
85   Ui::vvToolBinarize ui;
86   // std::vector<vvSlicerManager*> mSlicerManagers;
87 //   std::vector<vvSlicerManager*> mSlicerManagersCompatible;
88 //   vvImage::Pointer mCurrentImage;
89 //   vvSlicerManager * mCurrentSliceManager;
90   args_info_clitkBinarizeImage mArgsInfo;
91
92   vtkImageClip* mClipper;
93   vtkMarchingSquares* mSquares1;
94   vtkPolyDataMapper* mSquaresMapper1;
95   vtkActor* mSquaresActor1;
96
97 }; // end class vvToolBinarize
98 //------------------------------------------------------------------------------
99
100 #endif
101