Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qSlicerSegmentationsModuleWidget.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 the Applied Cancer Research Unit program of Cancer Care
17 Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18
19==============================================================================*/
20
21#ifndef __qSlicerSegmentationsModuleWidget_h
22#define __qSlicerSegmentationsModuleWidget_h
23
24// Slicer includes
26
27#include "qSlicerSegmentationsModuleExport.h"
28
29// SlicerRtCommon includes
31
32// CTK includes
33#include <ctkVTKObject.h>
34
35class qSlicerSegmentationsModuleWidgetPrivate;
39class vtkMRMLNodeReference;
40class vtkMRMLNode;
41class QItemSelection;
42class Ui_qSlicerSegmentationsModule;
43
44class Q_SLICER_QTMODULES_SEGMENTATIONS_EXPORT qSlicerSegmentationsModuleWidget :
46{
47 Q_OBJECT
48 QVTK_OBJECT
49
50public:
52 qSlicerSegmentationsModuleWidget(QWidget *parent=nullptr);
54
55 void enter() override;
56 void exit() override;
57
59 bool setEditedNode(vtkMRMLNode* node, QString role=QString(), QString context=QString()) override;
60
61public slots:
64
67
68protected:
69 void setup() override;
70 void onEnter();
71
73 void init();
74
78
86 vtkSegmentation* toSegmentation, QString segmentId, bool removeFromSource=false);
87
92 bool copySegmentsBetweenSegmentations(bool copyFromCurrentSegmentation, bool removeFromSource = false);
93
96
97protected slots:
100
103
106
108 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
109
112
116
119
125
130
135
136protected:
137 QScopedPointer<qSlicerSegmentationsModuleWidgetPrivate> d_ptr;
138
139private:
140 Q_DECLARE_PRIVATE(qSlicerSegmentationsModuleWidget);
141 Q_DISABLE_COPY(qSlicerSegmentationsModuleWidget);
142};
143#endif
qSlicerAbstractModuleWidget(QWidget *parent=nullptr)
qSlicerSegmentationsModuleWidget(QWidget *parent=nullptr)
vtkMRMLSegmentationDisplayNode * segmentationDisplayNode(bool create=false)
void setOtherSegmentationOrRepresentationNode(vtkMRMLNode *node)
Handle change of selection for the "other" node in copy/move/import/export.
void selectSegmentationNode(vtkMRMLSegmentationNode *segmentationNode)
Select segmentation node in module (workaround for issue that newly added nodes are not selected in t...
bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Support of node editing. Selects node in user interface that the user wants to edit.
bool copySegmentBetweenSegmentations(vtkSegmentation *fromSegmentation, vtkSegmentation *toSegmentation, QString segmentId, bool removeFromSource=false)
void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Callback function for selection changes in the main segment table view.
void updateCopyMoveButtonStates()
Update copy/move/import/export buttons based on selection.
void onSegmentationNodeReferenceChanged()
Populate source volume label and combobox for export.
QScopedPointer< qSlicerSegmentationsModuleWidgetPrivate > d_ptr
bool copySegmentsBetweenSegmentations(bool copyFromCurrentSegmentation, bool removeFromSource=false)
void updateWidgetFromMRML()
Update widget GUI from parameter node.
void onSegmentationNodeChanged(vtkMRMLNode *node)
Handle change of selected segmentation node.
void init()
Initialization function to enable automatic testing.
Abstract Superclass for all specific types of MRML nodes.
MRML node for representing segmentation display attributes.
MRML node containing segmentations.
MRML node to represent a complete subject hierarchy tree.
This class encapsulates a segmentation that can contain multiple segments and multiple representation...