Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerColorsModuleWidget.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 __qSlicerColorsModuleWidget_h
22 #define __qSlicerColorsModuleWidget_h
23 
24 // Slicer includes
26 
27 // Colors includes
28 #include "qSlicerColorsModuleExport.h"
29 
30 class qSlicerColorsModuleWidgetPrivate;
31 class vtkMRMLNode;
32 class vtkScalarBarWidget;
33 class QAbstractButton;
34 
35 class Q_SLICER_QTMODULES_COLORS_EXPORT qSlicerColorsModuleWidget
37 {
38  Q_OBJECT
39 public:
40 
42  qSlicerColorsModuleWidget(QWidget *parent=nullptr);
43  ~qSlicerColorsModuleWidget() override;
44 
45  bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
46 
47 public slots:
48  void setCurrentColorNode(vtkMRMLNode*);
49  void updateNumberOfColors();
50  void setLookupTableRange(double min, double max);
51  void copyCurrentColorNode();
52  void onDisplayableNodeChanged(vtkMRMLNode*);
53  void createColorLegend();
54  void deleteColorLegend();
55  void useCurrentColorsForColorLegend();
56 
57 protected slots:
58  void onMRMLColorNodeChanged(vtkMRMLNode* newColorNode);
59  void updateColorLegendFromMRML();
60 
61 protected:
62  void setup() override;
63  void setMRMLScene(vtkMRMLScene *scene) override;
64 
65 protected:
66  QScopedPointer<qSlicerColorsModuleWidgetPrivate> d_ptr;
67 
68 private:
69  Q_DECLARE_PRIVATE(qSlicerColorsModuleWidget);
70  Q_DISABLE_COPY(qSlicerColorsModuleWidget);
71 };
72 
73 #endif
Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
qSlicerAbstractModuleWidget Superclass
void setMRMLScene(vtkMRMLScene *scene) override
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
QScopedPointer< qSlicerColorsModuleWidgetPrivate > d_ptr
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167