Slicer  4.10
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 = NULL);
42 
43 public:
51  virtual double canAddNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID )const;
52 
54  virtual bool addNodeToSubjectHierarchy(vtkMRMLNode* node, vtkIdType parentItemID);
55 
62  virtual double canOwnSubjectHierarchyItem(vtkIdType itemID)const;
63 
66  Q_INVOKABLE virtual const QString roleForPlugin()const;
67 
69  virtual QString tooltip(vtkIdType itemID)const;
70 
72  virtual const QString helpText()const;
73 
76  virtual QIcon icon(vtkIdType itemID);
77 
79  virtual QIcon visibilityIcon(int visible);
80 
82  virtual void setDisplayVisibility(vtkIdType itemID, int visible);
83 
86  virtual int getDisplayVisibility(vtkIdType itemID)const;
87 
90 
93  virtual void showContextMenuActionsForItem(vtkIdType itemID);
94 
98 
101  virtual void showVisibilityContextMenuActionsForItem(vtkIdType itemID);
102 
103 public slots:
106  void onSegmentAdded(vtkObject* caller, void* callData);
107 
110  void onSegmentRemoved(vtkObject* caller, void* callData);
111 
114  void onSegmentModified(vtkObject* caller, void* callData);
115 
118  void onSubjectHierarchyItemModified(vtkObject* caller, void* callData);
119 
122  void onSubjectHierarchyItemAboutToBeRemoved(vtkObject* caller, void* callData);
123 
124 protected slots:
126  void exportToBinaryLabelmap();
127 
129  void exportToClosedSurface();
130 
132  void convertLabelmapToSegmentation();
133 
135  void convertModelToSegmentation();
136 
138  void convertModelHierarchyToSegmentation();
139 
141  void toggle2DFillVisibility(bool);
142 
144  void toggle2DOutlineVisibility(bool);
145 
147  void toggle3DVisibility(bool);
148 
149 protected:
150  QScopedPointer<qSlicerSubjectHierarchySegmentationsPluginPrivate> d_ptr;
151 
152  void updateAllSegmentsFromMRML(vtkMRMLSegmentationNode* segmentationNode);
153 
154 private:
157 };
158 
159 #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 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:138
virtual Q_INVOKABLE void showVisibilityContextMenuActionsForItem(vtkIdType itemID)
virtual Q_INVOKABLE double canOwnSubjectHierarchyItem(vtkIdType itemID) const
virtual Q_INVOKABLE QList< QAction * > itemContextMenuActions() const
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...