Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSubjectHierarchySegmentationsPlugin.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 __qSlicerSubjectHierarchySegmentationsPlugin_h
22 #define __qSlicerSubjectHierarchySegmentationsPlugin_h
23 
24 // Subject Hierarchy includes
26 
27 #include "qSlicerSegmentationsSubjectHierarchyPluginsExport.h"
28 
29 class qSlicerSubjectHierarchySegmentationsPluginPrivate;
31 
33 class Q_SLICER_SEGMENTATIONS_PLUGINS_EXPORT qSlicerSubjectHierarchySegmentationsPlugin : public qSlicerSubjectHierarchyAbstractPlugin
34 {
35 public:
36  Q_OBJECT
37 
38 public:
40  qSlicerSubjectHierarchySegmentationsPlugin(QObject* parent = nullptr);
42 
43 public:
51  double canAddNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID )const override;
52 
54  bool addNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID) override;
55 
64  double canReparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID)const override;
65 
68  bool reparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID) override;
69 
76  double canOwnSubjectHierarchyItem(vtkIdType itemID)const override;
77 
80  Q_INVOKABLE const QString roleForPlugin()const override;
81 
83  QString tooltip(vtkIdType itemID)const override;
84 
86  const QString helpText()const override;
87 
90  QIcon icon(vtkIdType itemID) override;
91 
93  QIcon visibilityIcon(int visible) override;
94 
96  void setDisplayVisibility(vtkIdType itemID, int visible) override;
97 
100  int getDisplayVisibility(vtkIdType itemID)const override;
101 
103  QList<QAction*> itemContextMenuActions()const override;
104 
107  void showContextMenuActionsForItem(vtkIdType itemID) override;
108 
112 
115  void showVisibilityContextMenuActionsForItem(vtkIdType itemID) override;
116 
117 public slots:
120  void onSegmentAdded(vtkObject* caller, void* callData);
121 
124  void onSegmentRemoved(vtkObject* caller, void* callData);
125 
128  void onSegmentModified(vtkObject* caller, void* callData);
129 
131  void onDisplayNodeModified(vtkObject* caller);
132 
135  void onSubjectHierarchyItemModified(vtkObject* caller, void* callData);
136 
139  void onSubjectHierarchyItemAboutToBeRemoved(vtkObject* caller, void* callData);
140 
141 protected slots:
143  void exportToBinaryLabelmap();
144 
146  void exportToClosedSurface();
147 
149  void convertLabelmapToSegmentation();
150 
152  void convertModelToSegmentation();
153 
155  void convertModelsToSegmentation();
156 
158  void toggle2DFillVisibility(bool);
159 
161  void toggle2DOutlineVisibility(bool);
162 
163 protected:
164  QScopedPointer<qSlicerSubjectHierarchySegmentationsPluginPrivate> d_ptr;
165 
166  void updateAllSegmentsFromMRML(vtkMRMLSegmentationNode* segmentationNode);
167 
168 private:
171 };
172 
173 #endif
virtual Q_INVOKABLE void setDisplayVisibility(vtkIdType itemID, int visible)
Set display visibility of an owned subject hierarchy item.
virtual QIcon icon(vtkIdType itemID)
virtual Q_INVOKABLE const QString roleForPlugin() const
virtual double canAddNodeToSubjectHierarchy(vtkMRMLNode *node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) const
virtual Q_INVOKABLE QString tooltip(vtkIdType itemID) const
Generate tooltip for a owned subject hierarchy item.
Abstract plugin for handling Subject Hierarchy items.
virtual double canReparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID) const
virtual Q_INVOKABLE int getDisplayVisibility(vtkIdType itemID) const
virtual bool addNodeToSubjectHierarchy(vtkMRMLNode *node, vtkIdType parentItemID)
virtual Q_INVOKABLE void showContextMenuActionsForItem(vtkIdType itemID)
virtual Q_INVOKABLE QIcon visibilityIcon(int visible)
Get visibility icon for a visibility state.
QScopedPointer< qSlicerSubjectHierarchySegmentationsPluginPrivate > d_ptr
virtual Q_INVOKABLE QList< QAction * > visibilityContextMenuActions() const
virtual const QString helpText() const
Get help text for plugin to be added in subject hierarchy module widget help box. ...
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual Q_INVOKABLE void showVisibilityContextMenuActionsForItem(vtkIdType itemID)
virtual Q_INVOKABLE double canOwnSubjectHierarchyItem(vtkIdType itemID) const
virtual bool reparentItemInsideSubjectHierarchy(vtkIdType itemID, vtkIdType parentItemID)
virtual Q_INVOKABLE QList< QAction * > itemContextMenuActions() const
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...