Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 // SlicerQt includes
26 
27 #include "qSlicerSegmentationsModuleExport.h"
28 
29 // SlicerRtCommon includes
31 
32 // CTK includes
33 #include <ctkVTKObject.h>
34 
35 class qSlicerSegmentationsModuleWidgetPrivate;
39 class vtkMRMLNodeReference;
40 class vtkMRMLNode;
42 class QItemSelection;
43 class Ui_qSlicerSegmentationsModule;
44 
46 class Q_SLICER_QTMODULES_SEGMENTATIONS_EXPORT qSlicerSegmentationsModuleWidget :
48 {
49  Q_OBJECT
50  QVTK_OBJECT
51 
52 public:
54  qSlicerSegmentationsModuleWidget(QWidget *parent=0);
56 
57  virtual void enter();
58  virtual void exit();
59 
61  virtual bool setEditedNode(vtkMRMLNode* node, QString role=QString(), QString context=QString());
62 
64  void setTerminologiesLogic(vtkSlicerTerminologiesModuleLogic* logic);
65 
66 public slots:
68  void updateWidgetFromMRML();
69 
71  void selectSegmentationNode(vtkMRMLSegmentationNode* segmentationNode);
72 
73 protected:
74  virtual void setup();
75  void onEnter();
76 
78  void init();
79 
82  vtkMRMLSegmentationDisplayNode* segmentationDisplayNode(bool create=false);
83 
90  bool copySegmentBetweenSegmentations(vtkSegmentation* fromSegmentation,
91  vtkSegmentation* toSegmentation, QString segmentId, bool removeFromSource=false);
92 
97  bool copySegmentsBetweenSegmentations(bool copyFromCurrentSegmentation, bool removeFromSource = false);
98 
99  bool exportFromCurrentSegmentation();
100  bool importToCurrentSegmentation();
101 
102 protected slots:
104  void onSegmentationNodeChanged(vtkMRMLNode* node);
105 
107  void setOtherSegmentationOrRepresentationNode(vtkMRMLNode* node);
108 
110  void updateCopyMoveButtonStates();
111 
113  void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
114 
116  void onSegmentationNodeReferenceChanged();
117 
118  void onAddSegment();
119  void onEditSelectedSegment();
120  void onRemoveSelectedSegments();
121 
122  void onImportExportOptionsButtonClicked();
123  void onImportExportApply();
124 
125  void onMoveFromCurrentSegmentation();
126  void onCopyFromCurrentSegmentation();
127  void onCopyToCurrentSegmentation();
128  void onMoveToCurrentSegmentation();
129 
130  void onMRMLSceneEndImportEvent();
131  void onMRMLSceneEndRestoreEvent();
132  void onMRMLSceneEndBatchProcessEvent();
133  void onMRMLSceneEndCloseEvent();
134 
135 protected:
136  QScopedPointer<qSlicerSegmentationsModuleWidgetPrivate> d_ptr;
137 
138 private:
139  Q_DECLARE_PRIVATE(qSlicerSegmentationsModuleWidget);
140  Q_DISABLE_COPY(qSlicerSegmentationsModuleWidget);
141 };
142 #endif
virtual Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString())
Node editing.
MRML node to represent a complete subject hierarchy tree.
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
MRML node for representing segmentation display attributes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
virtual Q_INVOKABLE void enter()
virtual Q_INVOKABLE void exit()
QScopedPointer< qSlicerSegmentationsModuleWidgetPrivate > d_ptr
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...