CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ctkVTKThresholdWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkVTKThresholdWidget_h
22 #define __ctkVTKThresholdWidget_h
23 
24 //Qt includes
25 #include <QWidget>
26 
27 // CTK includes
28 #include <ctkVTKObject.h>
29 #include "ctkVisualizationVTKWidgetsExport.h"
30 class ctkVTKThresholdWidgetPrivate;
31 
32 // VTK includes
33 class vtkPiecewiseFunction;
34 
36 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKThresholdWidget
37  : public QWidget
38 {
39  Q_OBJECT
43  Q_PROPERTY(double opacity READ opacity WRITE setOpacity DESIGNABLE false)
46  Q_PROPERTY(bool useSharpness READ useSharpness WRITE setUseSharpness)
47 public:
48  ctkVTKThresholdWidget(QWidget* parent = 0);
49  virtual ~ctkVTKThresholdWidget();
50 
51  vtkPiecewiseFunction* piecewiseFunction()const;
52 
53  void range(double* range)const;
54  void thresholdValues(double* values)const;
55  double opacity()const;
56 
57  bool useSharpness()const;
58  void setUseSharpness(bool use);
59 
60 public Q_SLOTS:
61  void setPiecewiseFunction(vtkPiecewiseFunction* function);
62  void setRange(double min, double max);
63  void setThresholdValues(double min, double max);
64  void setOpacity(double opacity);
65 
66 protected Q_SLOTS:
67  void updateFromPiecewiseFunction();
68 
69 protected:
70  QScopedPointer<ctkVTKThresholdWidgetPrivate> d_ptr;
71 
72 private:
73  Q_DECLARE_PRIVATE(ctkVTKThresholdWidget);
74  Q_DISABLE_COPY(ctkVTKThresholdWidget);
75 };
76 
77 #endif