Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSubjectHierarchyVolumesPlugin.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6  Queen's University, Kingston, ON, Canada. All Rights Reserved.
7 
8  See COPYRIGHT.txt
9  or http://www.slicer.org/copyright/copyright.txt for details.
10 
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16 
17  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18  and was supported through the Applied Cancer Research Unit program of Cancer Care
19  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20 
21 ==============================================================================*/
22 
23 #ifndef __qSlicerSubjectHierarchyVolumesPlugin_h
24 #define __qSlicerSubjectHierarchyVolumesPlugin_h
25 
26 // SubjectHierarchy includes
28 
29 #include "qSlicerVolumesSubjectHierarchyPluginsExport.h"
30 
31 // Slicer includes
33 
34 // CTK includes
35 #include <ctkVTKObject.h>
36 
37 class qSlicerSubjectHierarchyVolumesPluginPrivate;
39 
40 // Due to some reason the Python wrapping of this class fails, therefore
41 // put everything between BTX/ETX to exclude from wrapping.
42 // TODO investigate why the wrapping fails:
43 // https://www.assembla.com/spaces/slicerrt/tickets/210-python-wrapping-error-when-starting-up-slicer-with-slicerrt
44 //BTX
45 
47 class Q_SLICER_VOLUMES_SUBJECT_HIERARCHY_PLUGINS_EXPORT qSlicerSubjectHierarchyVolumesPlugin : public qSlicerSubjectHierarchyAbstractPlugin
48 {
49 public:
50  Q_OBJECT
51  QVTK_OBJECT
52 
53 public:
55  qSlicerSubjectHierarchyVolumesPlugin(QObject* parent = NULL);
57 
58 public:
66  virtual double canAddNodeToSubjectHierarchy(
67  vtkMRMLNode* node,
68  vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID )const;
69 
76  virtual double canOwnSubjectHierarchyItem(vtkIdType itemID)const;
77 
80  Q_INVOKABLE virtual const QString roleForPlugin()const;
81 
84  virtual QIcon icon(vtkIdType itemID);
85 
87  virtual QIcon visibilityIcon(int visible);
88 
90  virtual QString tooltip(vtkIdType itemID)const;
91 
93  virtual void setDisplayVisibility(vtkIdType itemID, int visible);
94 
97  virtual int getDisplayVisibility(vtkIdType itemID)const;
98 
101 
104  virtual void showContextMenuActionsForItem(vtkIdType itemID);
105 
106 public:
110  void showVolumeInAllViews(vtkMRMLScalarVolumeNode* node, int layer=vtkMRMLApplicationLogic::BackgroundLayer);
111 
113  void hideVolumeFromAllViews(vtkMRMLScalarVolumeNode* node);
114 
118  void collectShownVolumes( QSet<vtkIdType>& shownVolumeItemIDs,
120 
121 protected slots:
124  void showVolumesInBranch();
125 
128  void onLayoutChanged();
130  void onLayoutChanged(int layout);
131 
135  void onSliceCompositeNodeModified();
136 
137 protected:
138  QScopedPointer<qSlicerSubjectHierarchyVolumesPluginPrivate> d_ptr;
139 
140 private:
141  Q_DECLARE_PRIVATE(qSlicerSubjectHierarchyVolumesPlugin);
142  Q_DISABLE_COPY(qSlicerSubjectHierarchyVolumesPlugin);
143 };
144 
145 //ETX
146 
147 #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 Q_INVOKABLE void showContextMenuActionsForItem(vtkIdType itemID)
qSlicerSubjectHierarchyAbstractPlugin Superclass
virtual Q_INVOKABLE QIcon visibilityIcon(int visible)
Get visibility icon for a visibility state.
MRML node for representing a volume (image stack).
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
QScopedPointer< qSlicerSubjectHierarchyVolumesPluginPrivate > d_ptr
virtual Q_INVOKABLE double canOwnSubjectHierarchyItem(vtkIdType itemID) const
virtual Q_INVOKABLE QList< QAction * > itemContextMenuActions() const