Slicer  5.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLVolumePropertyNodeWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
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  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLVolumePropertyNodeWidget_h
22 #define __qMRMLVolumePropertyNodeWidget_h
23 
24 // Qt includes
25 #include <QWidget>
26 
27 // CTK includes
28 #include <ctkVTKObject.h>
29 
30 // VolumeRendering includes
31 #include "qSlicerVolumeRenderingModuleWidgetsExport.h"
32 class qMRMLVolumePropertyNodeWidgetPrivate;
33 
34 // MRML includes
35 class vtkMRMLNode;
37 
38 // VTK includes
39 class vtkControlPointsItem;
40 class vtkVolumeProperty;
41 
42 class Q_SLICER_MODULE_VOLUMERENDERING_WIDGETS_EXPORT qMRMLVolumePropertyNodeWidget
43  : public QWidget
44 {
45  Q_OBJECT
46  QVTK_OBJECT
47  Q_PROPERTY(bool threshold READ hasThreshold WRITE setThreshold)
48 
49 public:
51  typedef QWidget Superclass;
52  explicit qMRMLVolumePropertyNodeWidget(QWidget* parent=nullptr);
54 
57  vtkVolumeProperty* volumeProperty()const;
58 
62  void chartsBounds(double bounds[4])const;
63  void chartsExtent(double extent[4])const;
64 
65  void setThreshold(bool enable);
66  bool hasThreshold()const;
67 
68 public slots:
70  void setMRMLVolumePropertyNode(vtkMRMLNode* node);
71  void setMRMLVolumePropertyNode(vtkMRMLVolumePropertyNode* volumePropertyNode);
72 
73  void moveAllPoints(double x, double y = 0.,
74  bool dontMoveFirstAndLast = false);
75  void spreadAllPoints(double factor,
76  bool dontSpreadFirstAndLast = false);
77 
79  void setChartsExtent(double extent[2]);
80  void setChartsExtent(double min, double max);
81 
82 signals:
83  void thresholdChanged(bool enabled);
84  void volumePropertyChanged();
85  void chartsExtentChanged();
86 
87 protected slots:
88  void updateFromVolumePropertyNode();
89 
90 protected:
91  QScopedPointer<qMRMLVolumePropertyNodeWidgetPrivate> d_ptr;
92 
93 private:
94  Q_DECLARE_PRIVATE(qMRMLVolumePropertyNodeWidget);
95  Q_DISABLE_COPY(qMRMLVolumePropertyNodeWidget);
96 };
97 
98 #endif
QScopedPointer< qMRMLVolumePropertyNodeWidgetPrivate > d_ptr
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...