Slicer  5.3
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  Q_PROPERTY(double lowerThresholdBound READ lowerThresholdBound WRITE setLowerThresholdBound)
33  Q_PROPERTY(double upperThresholdBound READ upperThresholdBound WRITE setUpperThresholdBound)
34  Q_ENUMS(ControlMode)
35 
36 public:
39  explicit qMRMLVolumeThresholdWidget(QWidget* parent=nullptr);
40  ~qMRMLVolumeThresholdWidget() override;
41 
43  {
44  Auto = 0,
45  Manual = 1,
46  Off =2
47  };
48 
49  ControlMode autoThreshold() const;
50  void setAutoThreshold(ControlMode autoWindowLevel);
51 
53  bool isOff()const;
54 
57  double lowerThreshold()const;
58 
61  double upperThreshold()const;
62 
65  double lowerThresholdBound()const;
66 
69  double upperThresholdBound()const;
70 
71 signals:
74  void thresholdValuesChanged(double lowerThreshold, double upperThreshold);
77  void autoThresholdValueChanged(int value);
78 
79 public slots:
81  void setAutoThreshold(int autoThreshold);
82 
85  void setLowerThreshold(double lowerThreshold);
86 
89  void setUpperThreshold(double upperThreshold);
90 
93  void setLowerThresholdBound(double lowerThresholdBound);
94 
97  void setUpperThresholdBound(double upperThresholdBound);
98 
101  void setThreshold(double lowerThreshold, double upperThreshold);
102 
105  void setThresholdBounds(double min, double max);
106 
107 protected:
109  void updateWidgetFromMRMLDisplayNode() override;
110 
113  void setMinimum(double min);
114  void setMaximum(double max);
115 
116 private:
117  Q_DECLARE_PRIVATE(qMRMLVolumeThresholdWidget);
118  Q_DISABLE_COPY(qMRMLVolumeThresholdWidget);
119 };
120 
121 #endif
Abstract widget to represent and control the properties of a scalar volume node.
virtual void updateWidgetFromMRMLDisplayNode()