Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLWindowLevelWidget.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 __qMRMLWindowLevelWidget_h
19 #define __qMRMLWindowLevelWidget_h
20 
21 // Qt includes
22 
23 // CTK includes
24 #include "qMRMLVolumeWidget.h"
25 class qMRMLWindowLevelWidgetPrivate;
26 
27 class QMRML_WIDGETS_EXPORT qMRMLWindowLevelWidget
28  : public qMRMLVolumeWidget
29 {
30  Q_OBJECT
31 
32  Q_PROPERTY(ControlMode autoWindowLevel READ autoWindowLevel WRITE setAutoWindowLevel)
33  Q_PROPERTY(double window READ window WRITE setWindow)
34  Q_PROPERTY(double level READ level WRITE setLevel)
35  Q_PROPERTY(double minimumValue READ minimumValue WRITE setMinimumValue)
36  Q_PROPERTY(double maximumValue READ maximumValue WRITE setMaximumValue)
37  Q_PROPERTY(double minimumBound READ minimumBound WRITE setMinimumBound)
38  Q_PROPERTY(double maximumBound READ maximumBound WRITE setMaximumBound)
39  Q_ENUMS(ControlMode)
40 
41 public:
44  explicit qMRMLWindowLevelWidget(QWidget* parentWidget = nullptr);
45  ~qMRMLWindowLevelWidget() override;
46 
48  {
49  Auto = 0,
50  Manual = 1,
51  ManualMinMax =2
52  };
53 
55  void setAutoWindowLevel(ControlMode autoWindowLevel);
56  ControlMode autoWindowLevel() const;
57 
60  double window()const;
61 
64  double level()const;
65 
68  double minimumValue()const;
69 
72  double maximumValue()const;
73 
76  double minimumBound()const;
77 
80  double maximumBound()const;
81 
82 signals:
85  void windowLevelValuesChanged(double window, double level);
88  void autoWindowLevelValueChanged(ControlMode value);
89 
90 public slots:
92  void setAutoWindowLevel(int autoWindowLevel);
93 
96  void setWindow(double window);
97 
100  void setLevel(double level);
101 
104  void setWindowLevel(double window, double level);
105 
108  void setMinMaxRangeValue(double min, double max);
109  void setMinimumValue(double min);
110  void setMaximumValue(double max);
111 
112  void setMinimumBound(double min);
113  void setMaximumBound(double max);
114  void setMinMaxBounds(double min, double max);
115 
116 protected:
118  void updateWidgetFromMRMLDisplayNode() override;
119 
121  void updateWidgetFromMRMLVolumeNode() override;
122 
123 private:
124  Q_DECLARE_PRIVATE(qMRMLWindowLevelWidget);
125  Q_DISABLE_COPY(qMRMLWindowLevelWidget);
126 };
127 
128 #endif
Abstract widget to represent and control the properties of a scalar volume node.
QWidget Superclass
Constructors.
virtual void updateWidgetFromMRMLVolumeNode()
virtual void updateWidgetFromMRMLDisplayNode()