Slicer  5.0
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 
41 class Q_SLICER_VOLUMES_SUBJECT_HIERARCHY_PLUGINS_EXPORT qSlicerSubjectHierarchyVolumesPlugin : public qSlicerSubjectHierarchyAbstractPlugin
42 {
43 public:
44  Q_OBJECT
45  QVTK_OBJECT
46 
47 public:
49  qSlicerSubjectHierarchyVolumesPlugin(QObject* parent = nullptr);
51 
52 public:
53 
57 
61  void showViewContextMenuActionsForItem(vtkIdType itemID, QVariantMap eventData);
62 
71  vtkMRMLNode* node,
72  vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID )const override;
73 
80  double canOwnSubjectHierarchyItem(vtkIdType itemID)const override;
81 
84  Q_INVOKABLE const QString roleForPlugin()const override;
85 
88  QIcon icon(vtkIdType itemID) override;
89 
91  QIcon visibilityIcon(int visible) override;
92 
94  QString tooltip(vtkIdType itemID)const override;
95 
97  void setDisplayVisibility(vtkIdType itemID, int visible) override;
98 
101  int getDisplayVisibility(vtkIdType itemID)const override;
102 
106 
109  void showVisibilityContextMenuActionsForItem(vtkIdType itemID) override;
110 
112  bool showItemInView(vtkIdType itemID, vtkMRMLAbstractViewNode* viewNode, vtkIdList* allItemsToShow) override;
113 
114 public:
118  void showVolumeInAllViews(vtkMRMLScalarVolumeNode* node, int layer=vtkMRMLApplicationLogic::BackgroundLayer);
119 
121  void hideVolumeFromAllViews(vtkMRMLScalarVolumeNode* node);
122 
126  void collectShownVolumes( QSet<vtkIdType>& shownVolumeItemIDs,
128 
129 protected slots:
132  void showVolumesInBranch();
133 
135  void showVolumeInForeground();
136 
139  void onLayoutChanged();
141  void onLayoutChanged(int layout);
142 
146  void onSliceCompositeNodeModified();
147 
150  void toggleResetFieldOfViewOnShowAction(bool);
151 
155  void toggleResetViewOrientationOnShowAction(bool);
156 
158  void setVolumePreset(const QString& presetId);
159 
161  void toggleVisibilityForCurrentItem(bool);
162 
163 protected:
164  QScopedPointer<qSlicerSubjectHierarchyVolumesPluginPrivate> d_ptr;
165 
166 private:
167  Q_DECLARE_PRIVATE(qSlicerSubjectHierarchyVolumesPlugin);
168  Q_DISABLE_COPY(qSlicerSubjectHierarchyVolumesPlugin);
169 };
170 
171 #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 Q_INVOKABLE int getDisplayVisibility(vtkIdType itemID) const
qSlicerSubjectHierarchyAbstractPlugin Superclass
virtual Q_INVOKABLE void showViewContextMenuActionsForItem(vtkIdType itemID, QVariantMap eventData)
virtual Q_INVOKABLE QIcon visibilityIcon(int visible)
Get visibility icon for a visibility state.
virtual Q_INVOKABLE QList< QAction * > viewContextMenuActions() const
virtual Q_INVOKABLE QList< QAction * > visibilityContextMenuActions() const
MRML node for representing a volume (image stack).
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual Q_INVOKABLE void showVisibilityContextMenuActionsForItem(vtkIdType itemID)
QScopedPointer< qSlicerSubjectHierarchyVolumesPluginPrivate > d_ptr
virtual Q_INVOKABLE double canOwnSubjectHierarchyItem(vtkIdType itemID) const