Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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 : public qSlicerAbstractModuleWidget
45{
46 Q_OBJECT
47 QVTK_OBJECT
48
49public:
51 qSlicerSegmentationsModuleWidget(QWidget* parent = nullptr);
53
54 void enter() override;
55 void exit() override;
56
58 bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
59
60public slots:
63
66
67protected:
68 void setup() override;
69 void onEnter();
70
72 void init();
73
77
84 bool copySegmentBetweenSegmentations(vtkSegmentation* fromSegmentation, vtkSegmentation* toSegmentation, QString segmentId, bool removeFromSource = false);
85
90 bool copySegmentsBetweenSegmentations(bool copyFromCurrentSegmentation, bool removeFromSource = false);
91
94
95protected slots:
98
101
104
106 void onSegmentSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
107
110
114
117
123
128
133
134protected:
135 QScopedPointer<qSlicerSegmentationsModuleWidgetPrivate> d_ptr;
136
137private:
138 Q_DECLARE_PRIVATE(qSlicerSegmentationsModuleWidget);
139 Q_DISABLE_COPY(qSlicerSegmentationsModuleWidget);
140};
141#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...