Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLScalarsDisplayWidget.h
Go to the documentation of this file.
1 
2 /*==============================================================================
3 
4  Program: 3D Slicer
5 
6  Portions (c) Copyright 2020 Brigham and Women's Hospital (BWH) All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17 ==============================================================================*/
18 
19 #ifndef __qMRMLScalarsDisplayWidget_h
20 #define __qMRMLScalarsDisplayWidget_h
21 
22 // MRMLWidgets includes
23 #include "qMRMLWidget.h"
24 
25 // MRML includes
26 #include "vtkMRMLDisplayNode.h"
27 
28 // CTK includes
29 #include <ctkVTKObject.h>
30 
31 class qMRMLScalarsDisplayWidgetPrivate;
32 class vtkMRMLColorNode;
33 class vtkMRMLNode;
34 
35 class QMRML_WIDGETS_EXPORT qMRMLScalarsDisplayWidget : public qMRMLWidget
36 {
37  Q_OBJECT
38  QVTK_OBJECT
39 
40  Q_PROPERTY(vtkMRMLDisplayNode::ScalarRangeFlagType scalarRangeMode READ scalarRangeMode WRITE setScalarRangeMode)
41 
42 public:
45  explicit qMRMLScalarsDisplayWidget(QWidget* parentWidget = nullptr);
46  ~qMRMLScalarsDisplayWidget() override;
47 
49  vtkMRMLDisplayNode* mrmlDisplayNode()const;
52  QList<vtkMRMLDisplayNode*> mrmlDisplayNodes()const;
53 
54  bool scalarsVisibility()const;
55  QString activeScalarName()const;
56  vtkMRMLColorNode* scalarsColorNode()const;
57 
59  void setScalarRangeMode(vtkMRMLDisplayNode::ScalarRangeFlagType mode);
60  vtkMRMLDisplayNode::ScalarRangeFlagType scalarRangeMode() const;
61 
63  double minimumValue()const;
64 
66  double maximumValue()const;
67 
68 signals:
70  void scalarRangeModeValueChanged(vtkMRMLDisplayNode::ScalarRangeFlagType mode);
72  void displayNodeChanged();
73 
74 public slots:
76  void setMRMLDisplayNode(vtkMRMLDisplayNode* node);
78  void setMRMLDisplayNode(vtkMRMLNode* node);
83  void setMRMLDisplayNodes(QList<vtkMRMLDisplayNode*> displayNodes);
84 
85  void setScalarsVisibility(bool);
86  void setActiveScalarName(const QString&);
87  void setScalarsColorNode(vtkMRMLNode*);
88  void setScalarsColorNode(vtkMRMLColorNode*);
89  void setScalarsDisplayRange(double min, double max);
90  void setTresholdEnabled(bool b);
91  void setThresholdRange(double min, double max);
92 
94  void setScalarRangeMode(int scalarRangeMode);
95 
97  void setMinimumValue(double min);
98  void setMaximumValue(double max);
99 
100 protected slots:
102  void updateWidgetFromMRML();
103 
105  void onCurrentArrayActivated();
106 
107 protected:
108  QScopedPointer<qMRMLScalarsDisplayWidgetPrivate> d_ptr;
109 
110 private:
111  Q_DECLARE_PRIVATE(qMRMLScalarsDisplayWidget);
112  Q_DISABLE_COPY(qMRMLScalarsDisplayWidget);
115 };
116 
117 #endif
qMRMLWidget Superclass
Constructors.
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
Abstract MRML node to represent color information.
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
QScopedPointer< qMRMLScalarsDisplayWidgetPrivate > d_ptr