Slicer
5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Abstract plugin for handling Subject Hierarchy items. More...
#include <Modules/Loadable/SubjectHierarchy/Widgets/qSlicerSubjectHierarchyAbstractPlugin.h>
Public Types | |
enum | ActionSectionType { SectionTop = -400, SectionInteraction = -300, SectionComponent = -200, SectionNode = -100, SectionDefault = 0, SectionFolder = 100, SectionBottom = 200 } |
typedef QObject | Superclass |
Properties | |
QString | name |
Signals | |
void | requestExpandItem (vtkIdType itemID) |
Signal requesting expanding of the subject hierarchy tree item belonging to an item. More... | |
void | requestInvalidateFilter () const |
Public Member Functions | |
virtual bool | addNodeToSubjectHierarchy (vtkMRMLNode *node, vtkIdType parentItemID) |
virtual double | canAddNodeToSubjectHierarchy (vtkMRMLNode *node, vtkIdType parentItemID=vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) const |
virtual Q_INVOKABLE bool | canEditProperties (vtkIdType itemID) |
Returns true if the module can edit properties of this item using editProperties. More... | |
virtual Q_INVOKABLE double | canOwnSubjectHierarchyItem (vtkIdType itemID) const |
virtual double | canReparentItemInsideSubjectHierarchy (vtkIdType itemID, vtkIdType parentItemID) const |
virtual QString | displayedItemName (vtkIdType itemID) const |
virtual Q_INVOKABLE void | editProperties (vtkIdType itemID) |
Open module belonging to item and set inputs in opened module. More... | |
virtual Q_INVOKABLE QColor | getDisplayColor (vtkIdType itemID, QMap< int, QVariant > &terminologyMetaData) const |
virtual Q_INVOKABLE int | getDisplayVisibility (vtkIdType itemID) const |
virtual const QString | helpText () const |
Get help text for plugin to be added in subject hierarchy module widget help box. More... | |
virtual QIcon | icon (vtkIdType itemID) |
Q_INVOKABLE bool | isThisPluginOwnerOfItem (vtkIdType itemID) const |
Determines if the item is owned by this plugin. More... | |
virtual Q_INVOKABLE QList< QAction * > | itemContextMenuActions () const |
virtual QString | name () const |
Get the name of the plugin. More... | |
qSlicerSubjectHierarchyAbstractPlugin (QObject *parent=nullptr) | |
virtual bool | reparentItemInsideSubjectHierarchy (vtkIdType itemID, vtkIdType parentItemID) |
virtual Q_INVOKABLE const QString | roleForPlugin () const |
virtual Q_INVOKABLE QList< QAction * > | sceneContextMenuActions () const |
virtual Q_INVOKABLE void | setDisplayColor (vtkIdType itemID, QColor color, QMap< int, QVariant > terminologyMetaData) |
virtual Q_INVOKABLE void | setDisplayVisibility (vtkIdType itemID, int visible) |
Set display visibility of an owned subject hierarchy item. More... | |
virtual void | setName (QString name) |
virtual Q_INVOKABLE void | showContextMenuActionsForItem (vtkIdType itemID) |
virtual bool | showItemInView (vtkIdType itemID, vtkMRMLAbstractViewNode *viewNode, vtkIdList *allItemsToShow) |
virtual Q_INVOKABLE void | showViewContextMenuActionsForItem (vtkIdType itemID, QVariantMap eventData) |
virtual Q_INVOKABLE void | showVisibilityContextMenuActionsForItem (vtkIdType itemID) |
virtual Q_INVOKABLE QString | tooltip (vtkIdType itemID) const |
Generate tooltip for a owned subject hierarchy item. More... | |
virtual Q_INVOKABLE QList< QAction * > | viewContextMenuActions () const |
virtual Q_INVOKABLE QList< QAction * > | visibilityContextMenuActions () const |
virtual Q_INVOKABLE QIcon | visibilityIcon (int visible) |
Get visibility icon for a visibility state. More... | |
~qSlicerSubjectHierarchyAbstractPlugin () override | |
Static Public Member Functions | |
static Q_INVOKABLE void | setActionPosition (QAction *action, int section, int weight=0, double weightAdjustment=0.0) |
static Q_INVOKABLE qSlicerAbstractModuleWidget * | switchToModule (QString moduleName) |
Protected Member Functions | |
void | hideAllContextMenuActions () const |
Protected Attributes | |
QString | m_Name |
Name of the plugin. More... | |
Friends | |
class | qMRMLSubjectHierarchyTreeView |
class | qSlicerSubjectHierarchyPluginLogic |
Abstract plugin for handling Subject Hierarchy items.
In Widgets, not Plugins because the paths and libs need to be exported to extensions This class provides an interface and some default implementations for the common operations on subject hierarchy items. To exercise the default implementations, a Default plugin
Note about confidence values (
Plugin subclass naming convention:
Definition at line 65 of file qSlicerSubjectHierarchyAbstractPlugin.h.
typedef QObject qSlicerSubjectHierarchyAbstractPlugin::Superclass |
Definition at line 76 of file qSlicerSubjectHierarchyAbstractPlugin.h.
Definition at line 234 of file qSlicerSubjectHierarchyAbstractPlugin.h.
|
readwrite |
This property stores the name of the plugin Cannot be empty.
Definition at line 73 of file qSlicerSubjectHierarchyAbstractPlugin.h.
qSlicerSubjectHierarchyAbstractPlugin::qSlicerSubjectHierarchyAbstractPlugin | ( | QObject * | parent = nullptr | ) |
|
override |
|
virtual |
Add a node to subject hierarchy under a specified parent. This is basically a convenience function to call
node | Node to add to subject hierarchy |
parentItemID | Parent item of the added node |
Reimplemented in qSlicerSubjectHierarchyFolderPlugin, and qSlicerSubjectHierarchySegmentationsPlugin.
|
virtual |
Determines if a data node can be placed in the hierarchy using the actual plugin, and gets a confidence value for a certain MRML node (usually the type and possibly attributes are checked). Most plugins do not perform steps additional to the default, so the default implementation returns a 0 confidence value, which can be overridden in plugins that do handle special cases.
node | Node to be added to the hierarchy |
parentItemID | Prospective parent of the node to add. Default value is invalid. In that case the parent will be ignored, the confidence numbers are got based on the to-be child node alone. |
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, and qSlicerSubjectHierarchyTextsPlugin.
|
virtual |
Returns true if the module can edit properties of this item using editProperties.
|
virtual |
Determines if the actual plugin can handle a subject hierarchy item. The plugin with the highest confidence number will "own" the item in the subject hierarchy (set icon, tooltip, set context menu etc.)
item | Item to handle in the subject hierarchy tree |
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchyTextsPlugin, and qSlicerSubjectHierarchyDefaultPlugin.
|
virtual |
Determines if a subject hierarchy item can be reparented in the hierarchy using the current plugin, and gets a confidence value for the reparented item. Most plugins do not perform steps additional to the default, so the default implementation returns a 0 confidence value, which can be overridden in plugins that do handle special cases.
itemID | Item to be reparented in the hierarchy |
parentItemID | Prospective parent of the item to reparent. |
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchySegmentsPlugin, and qSlicerSubjectHierarchyTransformsPlugin.
|
virtual |
Generate displayed name for the owned subject hierarchy item corresponding to its role. The default implementation returns the associated data node's name if any, otherwise the item name
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin.
|
virtual |
Open module belonging to item and set inputs in opened module.
Reimplemented in qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, and qSlicerSubjectHierarchySegmentsPlugin.
|
virtual |
Get display color of an owned subject hierarchy item
terminologyMetaData | Output map containing terminology meta data. Contents: qSlicerTerminologyItemDelegate::TerminologyRole : string qSlicerTerminologyItemDelegate::NameRole : string qSlicerTerminologyItemDelegate::NameAutoGeneratedRole : bool qSlicerTerminologyItemDelegate::ColorAutoGeneratedRole : bool |
Reimplemented in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyModelsPlugin, and qSlicerSubjectHierarchyMarkupsPlugin.
|
virtual |
Get display visibility of an owned subject hierarchy item
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, and qSlicerSubjectHierarchyTablesPlugin.
|
virtual |
Get help text for plugin to be added in subject hierarchy module widget help box.
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchySegmentsPlugin, and qSlicerSubjectHierarchyDefaultPlugin.
|
protected |
Hide all context menu actions offered by the plugin. This method must be called as a first step in
|
virtual |
Get icon of an owned subject hierarchy item
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchyDefaultPlugin, and qSlicerSubjectHierarchyTextsPlugin.
Q_INVOKABLE bool qSlicerSubjectHierarchyAbstractPlugin::isThisPluginOwnerOfItem | ( | vtkIdType | itemID | ) | const |
Determines if the item is owned by this plugin.
|
virtual |
Get item context menu item actions to add to tree view. These item context menu actions can be shown in the implementations of
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyCloneNodePlugin, qSlicerSubjectHierarchyExportPlugin, and qSlicerSubjectHierarchyRegisterPlugin.
|
virtual |
Get the name of the plugin.
|
virtual |
Reparent an item that was already in the subject hierarchy under a new parent.
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchySegmentsPlugin, and qSlicerSubjectHierarchyTransformsPlugin.
|
signal |
Signal requesting expanding of the subject hierarchy tree item belonging to an item.
|
signal |
Signal requesting invalidating the filter model for the tree view (e.g. when an item is added or removed by the plugin)
|
virtual |
Get role that the plugin assigns to the subject hierarchy item. Each plugin should provide only one role.
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, qSlicerSubjectHierarchyTextsPlugin, and qSlicerSubjectHierarchyDefaultPlugin.
|
virtual |
Get scene context menu item actions to add to tree view. Also provides actions for right-click on empty area These context menu actions are shown for the scene in the implementations of
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyExportPlugin, and qSlicerSubjectHierarchyParseLocalDataPlugin.
|
static |
Set the action position within a subject hierarchy menu by setting section and weight.
section | specifies section where the menu item will appear. SectionDefault, SectionNode, SectionFolder, ... constants can be used. A separator is displayed between each menu section. |
weight | specifies the position of the action within the section. Lighter actions float up (actions that have lower weight appear higher in the menu). Valid range is -49 to 49. |
weightAdjustment | specifies additional weight that allows inserting an action right above or below another action. Valid range is -49.0 to 49.0 (non-integer values are allowed). |
|
virtual |
Set display color of an owned subject hierarchy item
color | Display color to set |
terminologyMetaData | Map containing terminology meta data. Contents: qSlicerTerminologyItemDelegate::TerminologyRole : string qSlicerTerminologyItemDelegate::NameRole : string qSlicerTerminologyItemDelegate::NameAutoGeneratedRole : bool qSlicerTerminologyItemDelegate::ColorAutoGeneratedRole : bool |
Reimplemented in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyModelsPlugin, and qSlicerSubjectHierarchyMarkupsPlugin.
|
virtual |
Set display visibility of an owned subject hierarchy item.
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, and qSlicerSubjectHierarchyTablesPlugin.
|
virtual |
Set the name of the plugin NOTE: name must be defined in constructor in C++ plugins, this can only be used in python scripted ones
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin.
|
inlinevirtual |
Show context menu actions valid for a given subject hierarchy item.
itemID | Subject Hierarchy item to show the context menu items for |
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchySceneViewsPlugin, qSlicerSubjectHierarchyCloneNodePlugin, qSlicerSubjectHierarchyExportPlugin, qSlicerSubjectHierarchyParseLocalDataPlugin, and qSlicerSubjectHierarchyRegisterPlugin.
Definition at line 156 of file qSlicerSubjectHierarchyAbstractPlugin.h.
|
virtual |
Show an item in a selected view. List of all other item IDs that will be shown in this request is also provided, as it may help in determining the optimal view setup. For example, if multiple volume nodes will be shown then the first node may be displayed as background and the second as foreground.
Reimplemented in qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyVolumeRenderingPlugin, and qSlicerSubjectHierarchyColorLegendPlugin.
|
inlinevirtual |
Show context menu actions valid for a given subject hierarchy item to be shown in the view.
itemID | Subject Hierarchy item to show the context menu items for |
eventData | Supplementary data for the item that may be considered for the menu (sub-item ID, attribute, etc.) |
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyVolumesPlugin, and qSlicerSubjectHierarchyViewContextMenuPlugin.
Definition at line 174 of file qSlicerSubjectHierarchyAbstractPlugin.h.
|
inlinevirtual |
Show visibility context menu actions valid for a given subject hierarchy item.
itemID | Subject Hierarchy item to show the visibility context menu items for |
Reimplemented in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyDefaultPlugin, qSlicerSubjectHierarchyVolumeRenderingPlugin, qSlicerSubjectHierarchyColorLegendPlugin, qSlicerSubjectHierarchyOpacityPlugin, and qSlicerSubjectHierarchyVisibilityPlugin.
Definition at line 164 of file qSlicerSubjectHierarchyAbstractPlugin.h.
|
static |
Switch to module with given name
|
virtual |
Generate tooltip for a owned subject hierarchy item.
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyModelsPlugin, and qSlicerSubjectHierarchyTextsPlugin.
|
virtual |
Get view context menu item actions that are available when right-clicking an object in the views. These item context menu actions can be shown in the implementations of
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyVolumesPlugin, and qSlicerSubjectHierarchyViewContextMenuPlugin.
|
virtual |
Get visibility context menu item actions to add to tree view. These item visibility context menu actions can be shown in the implementations of
Reimplemented in qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyDefaultPlugin, qSlicerSubjectHierarchyVolumeRenderingPlugin, qSlicerSubjectHierarchyColorLegendPlugin, qSlicerSubjectHierarchyOpacityPlugin, and qSlicerSubjectHierarchyVisibilityPlugin.
|
virtual |
Get visibility icon for a visibility state.
Reimplemented in qSlicerSubjectHierarchyScriptedPlugin, qSlicerSubjectHierarchyFolderPlugin, qSlicerSubjectHierarchySegmentationsPlugin, qSlicerSubjectHierarchyVolumesPlugin, qSlicerSubjectHierarchyTransformsPlugin, qSlicerSubjectHierarchySegmentsPlugin, qSlicerSubjectHierarchyPlotsPlugin, qSlicerSubjectHierarchyTablesPlugin, qSlicerSubjectHierarchyDiffusionTensorVolumesPlugin, qSlicerSubjectHierarchyLabelMapsPlugin, qSlicerSubjectHierarchyMarkupsPlugin, qSlicerSubjectHierarchyModelsPlugin, and qSlicerSubjectHierarchyDefaultPlugin.
|
friend |
Definition at line 278 of file qSlicerSubjectHierarchyAbstractPlugin.h.
|
friend |
Definition at line 279 of file qSlicerSubjectHierarchyAbstractPlugin.h.
|
protected |
Name of the plugin.
Definition at line 273 of file qSlicerSubjectHierarchyAbstractPlugin.h.