Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLVolumeThresholdWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 ==============================================================================*/
17 
18 #ifndef __qMRMLVolumeThresholdWidget_h
19 #define __qMRMLVolumeThresholdWidget_h
20 
22 #include "qMRMLVolumeWidget.h"
23 class qMRMLVolumeThresholdWidgetPrivate;
24 
25 class QMRML_WIDGETS_EXPORT qMRMLVolumeThresholdWidget
26  : public qMRMLVolumeWidget
27 {
28  Q_OBJECT
29  Q_PROPERTY(int autoThreshold READ autoThreshold WRITE setAutoThreshold)
30  Q_PROPERTY(double lowerThreshold READ lowerThreshold WRITE setLowerThreshold)
31  Q_PROPERTY(double upperThreshold READ upperThreshold WRITE setUpperThreshold)
32 
33 public:
36  explicit qMRMLVolumeThresholdWidget(QWidget* parent=0);
37  virtual ~qMRMLVolumeThresholdWidget();
38 
40  {
41  Auto = 0,
42  Manual = 1,
43  Off =2
44  };
45 
46  ControlMode autoThreshold() const;
47  void setAutoThreshold(ControlMode autoWindowLevel);
48 
50  bool isOff()const;
51 
54  double lowerThreshold()const;
55 
58  double upperThreshold()const;
59 
60 signals:
63  void thresholdValuesChanged(double lowerThreshold, double upperThreshold);
66  void autoThresholdValueChanged(int value);
67 
68 public slots:
70  void setAutoThreshold(int autoThreshold);
71 
74  void setLowerThreshold(double lowerThreshold);
75 
78  void setUpperThreshold(double upperThreshold);
79 
82  void setThreshold(double lowerThreshold, double upperThreshold);
83 
84 protected:
86  virtual void updateWidgetFromMRMLDisplayNode();
87 
90  void setMinimum(double min);
91  void setMaximum(double max);
92 
93 private:
94  Q_DECLARE_PRIVATE(qMRMLVolumeThresholdWidget);
95  Q_DISABLE_COPY(qMRMLVolumeThresholdWidget);
96 };
97 
98 #endif
Abstract widget to represent and control the properties of a scalar volume node.
virtual void updateWidgetFromMRMLDisplayNode()