Slicer  5.3
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 
120  bool showItemInView(vtkIdType itemID, vtkMRMLAbstractViewNode* viewNode, vtkIdList* allItemsToShow) override;
121 
122 public slots:
125  void onSegmentAdded(vtkObject* caller, void* callData);
126 
129  void onSegmentRemoved(vtkObject* caller, void* callData);
130 
133  void onSegmentModified(vtkObject* caller, void* callData);
134 
136  void onDisplayNodeModified(vtkObject* caller);
137 
140  void onSubjectHierarchyItemModified(vtkObject* caller, void* callData);
141 
144  void onSubjectHierarchyItemAboutToBeRemoved(vtkObject* caller, void* callData);
145 
146 protected slots:
148  void exportToBinaryLabelmap();
149 
151  void exportToClosedSurface();
152 
154  void convertLabelmapToSegmentation();
155 
157  void convertModelToSegmentation();
158 
160  void convertModelsToSegmentation();
161 
163  void toggle2DFillVisibility(bool);
164 
166  void toggle2DOutlineVisibility(bool);
167 
168  void createBinaryLabelmapRepresentation();
169  void createClosedSurfaceRepresentation();
170  void removeBinaryLabelmapRepresentation();
171  void removeClosedSurfaceRepresentation();
172 
173 protected:
174  QScopedPointer<qSlicerSubjectHierarchySegmentationsPluginPrivate> d_ptr;
175 
176  void updateAllSegmentsFromMRML(vtkMRMLSegmentationNode* segmentationNode);
177 
180  void updateRepresentation(const QString& representationName, bool create);
181 
182 private:
185 };
186 
187 #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.
virtual bool showItemInView(vtkIdType itemID, vtkMRMLAbstractViewNode *viewNode, vtkIdList *allItemsToShow)
Abstract plugin for handling Subject Hierarchy items.
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
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 ...