Slicer 5.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qMRMLSegmentSelectorWidget.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 __qMRMLSegmentSelectorWidget_h
24#define __qMRMLSegmentSelectorWidget_h
25
26// qMRMLWidgets includes
27#include "qMRMLWidget.h"
28#include "qMRMLWidgetsExport.h"
29
30// CTK includes
31#include <ctkPimpl.h>
32#include <ctkVTKObject.h>
33
34class vtkMRMLNode;
35class qMRMLSegmentSelectorWidgetPrivate;
36class QTableWidgetItem;
37class QItemSelection;
38class QStringList;
39
42class QMRML_WIDGETS_EXPORT qMRMLSegmentSelectorWidget : public qMRMLWidget
43{
44 Q_OBJECT
45 QVTK_OBJECT
46
47public:
48 Q_PROPERTY(bool noneEnabled READ noneEnabled WRITE setNoneEnabled)
49 Q_PROPERTY(bool editEnabled READ editEnabled WRITE setEditEnabled)
50 Q_PROPERTY(bool segmentationNodeSelectorVisible READ segmentationNodeSelectorVisible WRITE setSegmentationNodeSelectorVisible)
51 Q_PROPERTY(bool multiSelection READ multiSelection WRITE setMultiSelection)
52 Q_PROPERTY(bool horizontalLayout READ horizontalLayout WRITE setHorizontalLayout)
53 Q_PROPERTY(bool selectNodeUponCreation READ selectNodeUponCreation WRITE setSelectNodeUponCreation)
54
55public:
58
60 explicit qMRMLSegmentSelectorWidget(QWidget* parent = nullptr);
63
65 Q_INVOKABLE vtkMRMLNode* currentNode();
67 Q_INVOKABLE QString currentNodeID();
68
71 Q_INVOKABLE QString currentSegmentID();
74 Q_INVOKABLE QStringList selectedSegmentIDs();
75
80 Q_INVOKABLE QStringList segmentIDs();
81
84 bool noneEnabled()const;
87 void setNoneEnabled(bool enable);
88
91 bool editEnabled()const;
94 void setEditEnabled(bool enable);
95
98 bool segmentationNodeSelectorVisible()const;
101 void setSegmentationNodeSelectorVisible(bool visible);
102
105 bool multiSelection()const;
108 void setMultiSelection(bool multi);
109
112 bool horizontalLayout()const;
115 void setHorizontalLayout(bool horizontal);
116
120 bool selectNodeUponCreation()const;
121 void setSelectNodeUponCreation(bool value);
122
123public slots:
125 Q_INVOKABLE void setCurrentNode(vtkMRMLNode* node);
127 Q_INVOKABLE void setCurrentNodeID(const QString& nodeID);
128
131 Q_INVOKABLE void setCurrentSegmentID(QString segmentID);
134 Q_INVOKABLE void setSelectedSegmentIDs(QStringList segmentIDList);
135
136protected slots:
138 Q_INVOKABLE void onCurrentNodeChanged(vtkMRMLNode* node);
140 void onCurrentSegmentChanged(int index);
142 void onSegmentMultiSelectionChanged();
143
145 void populateSegmentCombobox();
146
147signals:
148 void currentNodeChanged(vtkMRMLNode*);
149 void currentSegmentChanged(QString);
150 void segmentSelectionChanged(QStringList);
151
153 void nodeAboutToBeEdited(vtkMRMLNode* node);
154
158 void currentNodeChanged(bool validNode);
159
160protected:
161 QScopedPointer<qMRMLSegmentSelectorWidgetPrivate> d_ptr;
162
163private:
164 Q_DECLARE_PRIVATE(qMRMLSegmentSelectorWidget);
165 Q_DISABLE_COPY(qMRMLSegmentSelectorWidget);
166};
167
168#endif
Qt widget for selecting a single segment from a segmentation. If multiple segments are needed,...
Base class for any widget that requires a MRML Scene.
Definition qMRMLWidget.h:36
Abstract Superclass for all specific types of MRML nodes.