Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLSegmentationDisplayNodeWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. 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  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18  and was supported through the Applied Cancer Research Unit program of Cancer Care
19  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20 
21 ==============================================================================*/
22 
23 #ifndef __qMRMLSegmentationDisplayNodeWidget_h
24 #define __qMRMLSegmentationDisplayNodeWidget_h
25 
26 // MRMLWidgets includes
27 #include "qMRMLWidget.h"
28 
29 #include "qSlicerSegmentationsModuleWidgetsExport.h"
30 
31 // CTK includes
32 #include <ctkPimpl.h>
33 #include <ctkVTKObject.h>
34 
35 class qMRMLSegmentationDisplayNodeWidgetPrivate;
36 
39 class QItemSelection;
40 
44 class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_EXPORT qMRMLSegmentationDisplayNodeWidget : public qMRMLWidget
45 {
46  Q_OBJECT
47  QVTK_OBJECT
48 
49 public:
51  explicit qMRMLSegmentationDisplayNodeWidget(QWidget* parent = nullptr);
54 
56  Q_INVOKABLE vtkMRMLSegmentationDisplayNode* segmentationDisplayNode() const;
58  Q_INVOKABLE QString segmentationDisplayNodeID();
59 
61  Q_INVOKABLE QString currentSegmentID();
62 
63 public slots:
65  Q_INVOKABLE void setSegmentationDisplayNode(vtkMRMLSegmentationDisplayNode* node);
67  Q_INVOKABLE void setSegmentationNode(vtkMRMLSegmentationNode* node);
68 
70  Q_INVOKABLE void setCurrentSegmentID(QString segmentID);
71 
73  void updateWidgetFromMRML();
74 
76  void populate3DRepresentationsCombobox();
78  void populate2DRepresentationsCombobox();
79 
80  void onVisibilityChanged(int);
81  void onOpacityChanged(double);
82  void onVisibilitySliceFillChanged(int);
83  void onVisibilitySliceOutlineChanged(int);
84  void onVisibility3DChanged(int);
85  void onOpacitySliceFillChanged(double);
86  void onOpacitySliceOutlineChanged(double);
87  void onOpacity3DChanged(double);
88  void onSliceIntersectionThicknessChanged(int);
89  void onRepresentation3DChanged(int);
90  void onRepresentation2DChanged(int);
91  void onSegmentVisibilitySliceFillChanged(int);
92  void onSegmentVisibilitySliceOutlineChanged(int);
93  void onSegmentVisibility3DChanged(int);
94  void onSegmentOpacitySliceFillChanged(double);
95  void onSegmentOpacitySliceOutlineChanged(double);
96  void onSegmentOpacity3DChanged(double);
97 
99  void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
100 
101 protected:
103  void updateSelectedSegmentSection();
104 
105 protected:
106  QScopedPointer<qMRMLSegmentationDisplayNodeWidgetPrivate> d_ptr;
107 
108 private:
109  Q_DECLARE_PRIVATE(qMRMLSegmentationDisplayNodeWidget);
110  Q_DISABLE_COPY(qMRMLSegmentationDisplayNodeWidget);
111 };
112 
113 #endif
QScopedPointer< qMRMLSegmentationDisplayNodeWidgetPrivate > d_ptr
MRML node for representing segmentation display attributes.
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
Qt widget for selecting a single segment from a segmentation. If multiple segments are needed...
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...