Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerVolumeRenderingPresetComboBox.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
16  and was supported through CANARIE's Research Software Program, and Cancer
17  Care Ontario.
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerVolumeRenderingPresetComboBox_h
22 #define __qSlicerVolumeRenderingPresetComboBox_h
23 
24 // Slicer includes
25 #include "qSlicerWidget.h"
26 #include "qSlicerVolumeRenderingModuleWidgetsExport.h"
27 
28 // qSlicerVolumeRendering includes
30 
31 class vtkMRMLNode;
33 class qSlicerVolumeRenderingPresetComboBoxPrivate;
34 
35 class Q_SLICER_MODULE_VOLUMERENDERING_WIDGETS_EXPORT qSlicerVolumeRenderingPresetComboBox
36  : public qSlicerWidget
37 {
38  Q_OBJECT
39  Q_PROPERTY(bool showIcons READ showIcons WRITE setShowIcons)
40 
41 public:
44  explicit qSlicerVolumeRenderingPresetComboBox(QWidget* parent=nullptr);
46 
49  Q_INVOKABLE vtkMRMLNode* currentNode()const;
52  Q_INVOKABLE QString currentNodeID()const;
53 
56  Q_INVOKABLE vtkMRMLVolumePropertyNode* mrmlVolumePropertyNode()const;
57 
58  bool showIcons()const;
59  void setShowIcons(bool show);
60 
61 public slots:
63  void setCurrentNode(vtkMRMLNode* node);
66  void setCurrentNodeID(const QString& nodeID);
67 
70  void setMRMLVolumePropertyNode(vtkMRMLNode* node);
71 
72  void updatePresetSliderRange();
73  void applyPreset(vtkMRMLNode* volumePropertyNode);
74 
75 signals:
76  void currentNodeChanged(vtkMRMLNode* node);
77  void currentNodeIDChanged(const QString& id);
78 
81  void presetOffsetChanged(double xOffset, double yOffset, bool dontMoveFirstAndLast);
82 
83 protected slots:
84  void startInteraction();
85  void endInteraction();
86  void interaction();
87 
88  void offsetPreset(double newPosition);
89  void resetOffset();
90 
91 protected:
92  QScopedPointer<qSlicerVolumeRenderingPresetComboBoxPrivate> d_ptr;
93 
94 private:
95  Q_DECLARE_PRIVATE(qSlicerVolumeRenderingPresetComboBox);
97 };
98 
99 #endif
QScopedPointer< qSlicerVolumeRenderingPresetComboBoxPrivate > d_ptr
MRML node for representing a volume (image stack).
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...