Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLSubjectHierarchyTreeView Class Reference

#include <Modules/Loadable/SubjectHierarchy/Widgets/qMRMLSubjectHierarchyTreeView.h>

Inheritance diagram for qMRMLSubjectHierarchyTreeView:
Collaboration diagram for qMRMLSubjectHierarchyTreeView:

Public Types

typedef QTreeView Superclass
 

Properties

bool addNodeMenuActionVisible
 This property controls whether the add node context menu of the scene is visible for node types specified in "nodeTypes" property.
 
QString attributeNameFilter
 
QString attributeValueFilter
 
bool colorColumnVisible
 
bool contextMenuEnabled
 Flag determining whether context menu is enabled.
 
bool descriptionColumnVisible
 
bool editMenuActionVisible
 This property controls whether the Edit properties context menu action is visible. Visible by default.
 
QStringList excludeItemAttributeNamesFilter
 
QStringList excludeNodeAttributeNamesFilter
 
QStringList hideChildNodeTypes
 
bool highlightReferencedItems
 
bool idColumnVisible
 
QStringList includeItemAttributeNamesFilter
 Filter to show only items that contain any of the given attributes with this name. Empty by default.
 
QStringList includeNodeAttributeNamesFilter
 Filter to show only items for data nodes that contain any of the given attributes with this name. Empty by default.
 
QStringList levelFilter
 
bool multiSelection
 Flag determining whether multiple items can be selected.
 
QString nameFilter
 
QStringList nodeTypes
 
QString noneDisplay
 
bool noneEnabled
 
QStringList pluginAllowList
 
QStringList pluginBlockList
 
bool selectRoleSubMenuVisible
 This property controls whether the Select role context menu sub-menu is visible. Visible by default.
 
QVTK_OBJECTbool showRootItem
 
bool transformColumnVisible
 
bool useTerminologySelector
 Double-clicking the color will show a standard terminology selector if true, otherwise show simple color picker.
 
bool visibilityColumnVisible
 

Public Slots

virtual vtkMRMLNodeaddNode (QString nodeType)
 Creates a node of the same type as in the "node types" property.
 
virtual void collapseItem (vtkIdType itemID)
 Handle collapse item requests in the subject hierarchy tree. Collapses branch.
 
void deleteSelectedItems ()
 Delete selected subject hierarchy items and associated data nodes.
 
void disablePlugin (QString plugin)
 
virtual void editCurrentItem ()
 Edit properties of current item.
 
virtual void expandItem (vtkIdType itemID)
 Handle expand item requests in the subject hierarchy tree. Expands branch.
 
void hideSelectedItems ()
 Hide selected subject hierarchy items.
 
void renameCurrentItem ()
 Rename currently selected one item by popping up a dialog.
 
void resetColumnSizesToDefault ()
 Resets column sizes and size policies to default.
 
virtual void selectPluginForCurrentItem ()
 Handle manual selection of a plugin as the new owner of a subject hierarchy node.
 
void setAddNodeMenuActionVisible (bool show)
 Set whether to show the "Create node" actions in the context menu of the scene.
 
void setAttributeNameFilter (QString &filter)
 
void setAttributeValueFilter (QString &filter)
 
void setContextMenuEnabled (bool enabled)
 
virtual void setCurrentItem (vtkIdType itemID)
 Set current (=selected) subject hierarchy item.
 
virtual void setCurrentItems (QList< vtkIdType > items)
 Set current (=selected) subject hierarchy items.
 
virtual void setCurrentItems (vtkIdList *items)
 Python compatibility function to set current (=selected) subject hierarchy items.
 
virtual void setCurrentNode (vtkMRMLNode *node)
 Convenience method to set current item by associated data node.
 
void setEditMenuActionVisible (bool visible)
 
void setExcludeItemAttributeNamesFilter (QStringList filter)
 
void setExcludeNodeAttributeNamesFilter (QStringList filter)
 
void setHighlightReferencedItems (bool highlightOn)
 
void setIncludeItemAttributeNamesFilter (QStringList filter)
 
void setIncludeNodeAttributeNamesFilter (QStringList filter)
 
virtual void setMRMLScene (vtkMRMLScene *scene)
 Set MRML scene.
 
virtual void setMultiSelection (bool multiSelectionOn)
 Set multi-selection.
 
void setNoneDisplay (const QString &displayName)
 
void setNoneEnabled (bool enable)
 
void setPluginAllowList (QStringList allowlist)
 
void setPluginAllowlist (QStringList allowlist)
 Deprecated. Use setPluginAllowList instead.
 
void setPluginBlacklist (QStringList blocklist)
 Deprecated. Use setPluginBlocklist instead.
 
void setPluginBlockList (QStringList blocklist)
 
void setPluginBlocklist (QStringList blocklist)
 Deprecated. Use setPluginBlockList instead.
 
void setPluginWhitelist (QStringList allowlist)
 Deprecated. Use setPluginAllowlist instead.
 
virtual void setRootItem (vtkIdType itemID)
 Set subject hierarchy item to be the root in the shown tree.
 
void setSelectRoleSubMenuVisible (bool visible)
 
void setShowRootItem (bool show)
 Set root item visibility.
 
void setUseTerminologySelector (bool useTerminologySelector)
 Set if standard terminologies are used for choosing segment name and color.
 
bool showContextMenuHint (bool visibility=false)
 
void showSelectedItems ()
 Show selected subject hierarchy items.
 
void toggleVisibilityOfSelectedItems ()
 Toggle visibility of selected subject hierarchy items.
 
virtual void updateSelectPluginActions ()
 

Signals

void currentItemChanged (vtkIdType)
 
void currentItemModified (vtkIdType)
 
void currentItemsChanged (QList< vtkIdType >)
 
void currentNodeChanged (vtkMRMLNode *)
 
void nodeAddedByUser (vtkMRMLNode *node)
 Signal emitted when node is added by the user.
 

Public Member Functions

Q_INVOKABLE void addItemAttributeFilter (QString attributeName, QVariant attributeValue=QString(), bool include=true)
 
Q_INVOKABLE void addNodeAttributeFilter (QString attributeName, QVariant attributeValue=QString(), bool include=true, QString className=QString())
 
bool addNodeMenuActionVisible () const
 Get whether the "Create node" actions are shown in the context menu of the scene.
 
QString attributeNameFilter () const
 
QString attributeValueFilter () const
 
QString baseName (const QString &nodeType="") const
 
bool colorColumnVisible ()
 
bool contextMenuEnabled () const
 
Q_INVOKABLE vtkIdType currentItem () const
 Get current (=selected) item. If there are multiple items selected, then the first one is returned.
 
QList< vtkIdType > currentItems ()
 Get current (=selected) items.
 
Q_INVOKABLE void currentItems (vtkIdList *selectedItems)
 
virtual vtkMRMLNodecurrentNode () const
 Convenience method to set current item by associated data node.
 
bool descriptionColumnVisible ()
 
Q_INVOKABLE int displayedItemCount () const
 Determine the number of shown items.
 
bool editMenuActionVisible () const
 
QStringList excludeItemAttributeNamesFilter () const
 
QStringList excludeNodeAttributeNamesFilter () const
 
Q_INVOKABLE vtkMRMLNodefindFirstNodeByClass (const QString &className) const
 
QStringList hideChildNodeTypes () const
 
bool highlightReferencedItems () const
 
bool idColumnVisible ()
 
QStringList includeItemAttributeNamesFilter () const
 
QStringList includeNodeAttributeNamesFilter () const
 
QStringList levelFilter () const
 
Q_INVOKABLE qMRMLSubjectHierarchyModelmodel () const
 
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 
bool multiSelection ()
 Get whether multi-selection is enabled.
 
QString nameFilter () const
 
Q_INVOKABLE QString nodeTypeLabel (const QString &nodeType) const
 
QStringList nodeTypes () const
 
QString noneDisplay () const
 
bool noneEnabled () const
 
QStringList pluginAllowList () const
 
QStringList pluginBlockList () const
 
 qMRMLSubjectHierarchyTreeView (QWidget *parent=nullptr)
 
Q_INVOKABLE void removeAttributeFilter ()
 Remove item attribute filtering.
 
Q_INVOKABLE void removeItemAttributeFilter (QString attributeName, bool include)
 Remove all item attribute filters specifying a given attribute name and include flag.
 
Q_INVOKABLE void removeItemAttributeFilter (QString attributeName, QVariant attributeValue, bool include)
 Remove single item attribute filter specifying each attribute.
 
Q_INVOKABLE void removeNodeAttributeFilter (QString attributeName, bool include)
 Remove all node attribute filters specifying a given attribute name and include flag.
 
Q_INVOKABLE void removeNodeAttributeFilter (QString attributeName, QVariant attributeValue, bool include, QString className)
 Remove single node attribute filter specifying each attribute.
 
Q_INVOKABLE vtkIdType rootItem () const
 Get root item of the tree.
 
bool selectRoleSubMenuVisible () const
 
Q_INVOKABLE void setAttributeFilter (const QString &attributeName, const QVariant &attributeValue=QVariant())
 
void setBaseName (const QString &baseName, const QString &nodeType="")
 
void setColorColumnVisible (bool visible)
 Set color column visibility.
 
void setDescriptionColumnVisible (bool visible)
 Set description column visibility.
 
void setHideChildNodeTypes (const QStringList &types)
 
void setIdColumnVisible (bool visible)
 Set ID column visibility.
 
void setLevelFilter (QStringList &levelFilter)
 Set level filter that allows showing only items at a specified level and their parents. Show all items if empty.
 
void setNameFilter (QString &nameFilter)
 Set name filter that allows showing only items containing a specified string (case-insensitive). Show all items if empty.
 
Q_INVOKABLE void setNodeTypeLabel (const QString &label, const QString &nodeType)
 
void setNodeTypes (const QStringList &types)
 Set node type filter that allows showing only data nodes of a certain type. Show all data nodes if empty.
 
void setTransformColumnVisible (bool visible)
 Set transform column visibility.
 
void setVisibilityColumnVisible (bool visible)
 Set visibility column visibility.
 
bool showRootItem () const
 Get root item visibility.
 
Q_INVOKABLE qMRMLSortFilterSubjectHierarchyProxyModelsortFilterProxyModel () const
 
Q_INVOKABLE vtkMRMLSubjectHierarchyNodesubjectHierarchyNode () const
 
bool transformColumnVisible ()
 
bool useTerminologySelector () const
 
bool visibilityColumnVisible ()
 
 ~qMRMLSubjectHierarchyTreeView () override
 

Protected Slots

virtual void addNode ()
 
void onCustomContextMenu (const QPoint &point)
 
virtual void onItemCollapsed (const QModelIndex &collapsedItemIndex)
 Updates subject hierarchy item expanded property when item is collapsed.
 
virtual void onItemExpanded (const QModelIndex &expandedItemIndex)
 Updates subject hierarchy item expanded property when item is expanded.
 
virtual void onMRMLSceneEndBatchProcess (vtkObject *sceneObject)
 Called when batch processing ends. Restores selection, which is lost when the hierarchy is rebuilt.
 
virtual void onMRMLSceneEndClose (vtkObject *sceneObject)
 Called when scene close is finished. Hierarchy is cleared in that case.
 
virtual void onMRMLSceneStartBatchProcess (vtkObject *sceneObject)
 Called when batch processing starts. Makes sure stored selection does not get emptied before restoring.
 
virtual void onMRMLSceneStartClose (vtkObject *sceneObject)
 Called when scene close is started.
 
virtual void onSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 
virtual void onSubjectHierarchyItemModified (vtkObject *caller, void *callData)
 Propagate item modified event.
 
virtual void onSubjectHierarchyItemTransformModified (vtkObject *caller, void *callData)
 Propagate item transform modified event.
 
virtual void updateRootItem ()
 

Protected Member Functions

void applyReferenceHighlightForItems (QList< vtkIdType > itemIDs)
 
void changeEvent (QEvent *e) override
 
virtual bool clickDecoration (QMouseEvent *e)
 
vtkIdType firstSelectedSubjectHierarchyItemInBranch (vtkIdType itemID)
 
void keyPressEvent (QKeyEvent *e) override
 Handle key press event.
 
void mousePressEvent (QMouseEvent *e) override
 Handle mouse press event.
 
virtual void populateContextMenuForItem (vtkIdType itemID)
 
virtual void populateTransformContextMenuForItem (vtkIdType itemID)
 Populate transform context menu for given subject hierarchy item.
 
virtual void populateVisibilityContextMenuForItem (vtkIdType itemID)
 Populate visibility context menu for given subject hierarchy item.
 
virtual void setSubjectHierarchyNode (vtkMRMLSubjectHierarchyNode *shNode)
 Set the subject hierarchy node found in the given scene. Called only internally.
 

Protected Attributes

QScopedPointer< qMRMLSubjectHierarchyTreeViewPrivate > d_ptr
 

Friends

class qMRMLSubjectHierarchyComboBox
 

Detailed Description

Definition at line 43 of file qMRMLSubjectHierarchyTreeView.h.

Member Typedef Documentation

◆ Superclass

Definition at line 112 of file qMRMLSubjectHierarchyTreeView.h.

Property Documentation

◆ addNodeMenuActionVisible

bool qMRMLSubjectHierarchyTreeView::addNodeMenuActionVisible
readwrite

This property controls whether the add node context menu of the scene is visible for node types specified in "nodeTypes" property.

Definition at line 62 of file qMRMLSubjectHierarchyTreeView.h.

◆ attributeNameFilter

QString qMRMLSubjectHierarchyTreeView::attributeNameFilter
readwrite

Filter to show only items that contain an item attribute with this name. Empty by default. Sets and returns the first attribute in

See also
includeItemAttributeNamesFilter.
Deprecated
Kept only for backwards compatibility. Use addItemAttributeFilter() or removeItemAttributeFilter() instead.

Definition at line 101 of file qMRMLSubjectHierarchyTreeView.h.

◆ attributeValueFilter

QString qMRMLSubjectHierarchyTreeView::attributeValueFilter
readwrite

Filter to show only items that contain any item attribute given in

See also
includeItemAttributeNamesFilter with the value. If empty, then existence of the attributes is enough to show. Exact match is required. Empty by default.
Deprecated
Kept only for backwards compatibility. Use addItemAttributeFilter() or removeItemAttributeFilter() instead.

Definition at line 106 of file qMRMLSubjectHierarchyTreeView.h.

◆ colorColumnVisible

bool qMRMLSubjectHierarchyTreeView::colorColumnVisible
readwrite

Definition at line 73 of file qMRMLSubjectHierarchyTreeView.h.

◆ contextMenuEnabled

bool qMRMLSubjectHierarchyTreeView::contextMenuEnabled
readwrite

Flag determining whether context menu is enabled.

Definition at line 58 of file qMRMLSubjectHierarchyTreeView.h.

◆ descriptionColumnVisible

bool qMRMLSubjectHierarchyTreeView::descriptionColumnVisible
readwrite

Definition at line 75 of file qMRMLSubjectHierarchyTreeView.h.

◆ editMenuActionVisible

bool qMRMLSubjectHierarchyTreeView::editMenuActionVisible
readwrite

This property controls whether the Edit properties context menu action is visible. Visible by default.

Definition at line 60 of file qMRMLSubjectHierarchyTreeView.h.

◆ excludeItemAttributeNamesFilter

QStringList qMRMLSubjectHierarchyTreeView::excludeItemAttributeNamesFilter
readwrite

Filter to hide items that contain any of the given attributes with this name. Empty by default Overrides

See also
includeItemAttributeNamesFilter

Definition at line 93 of file qMRMLSubjectHierarchyTreeView.h.

◆ excludeNodeAttributeNamesFilter

QStringList qMRMLSubjectHierarchyTreeView::excludeNodeAttributeNamesFilter
readwrite

Filter to hide items for data nodes that contain any of the given attributes with this name. Empty by default Overrides

See also
includeNodeAttributeNamesFilter

Definition at line 96 of file qMRMLSubjectHierarchyTreeView.h.

◆ hideChildNodeTypes

QStringList qMRMLSubjectHierarchyTreeView::hideChildNodeTypes
readwrite

Definition at line 70 of file qMRMLSubjectHierarchyTreeView.h.

◆ highlightReferencedItems

bool qMRMLSubjectHierarchyTreeView::highlightReferencedItems
readwrite

Flag determining whether to highlight items referenced by DICOM. Storing DICOM references: Referenced SOP instance UIDs (in attribute named vtkMRMLSubjectHierarchyConstants::GetDICOMReferencedInstanceUIDsAttributeName()) -> SH item instance UIDs (serialized string lists in subject hierarchy UID vtkMRMLSubjectHierarchyConstants::GetDICOMInstanceUIDName())

Definition at line 56 of file qMRMLSubjectHierarchyTreeView.h.

◆ idColumnVisible

bool qMRMLSubjectHierarchyTreeView::idColumnVisible
readwrite

Definition at line 72 of file qMRMLSubjectHierarchyTreeView.h.

◆ includeItemAttributeNamesFilter

QStringList qMRMLSubjectHierarchyTreeView::includeItemAttributeNamesFilter
readwrite

Filter to show only items that contain any of the given attributes with this name. Empty by default.

Definition at line 88 of file qMRMLSubjectHierarchyTreeView.h.

◆ includeNodeAttributeNamesFilter

QStringList qMRMLSubjectHierarchyTreeView::includeNodeAttributeNamesFilter
readwrite

Filter to show only items for data nodes that contain any of the given attributes with this name. Empty by default.

Definition at line 90 of file qMRMLSubjectHierarchyTreeView.h.

◆ levelFilter

QStringList qMRMLSubjectHierarchyTreeView::levelFilter
readwrite

Definition at line 67 of file qMRMLSubjectHierarchyTreeView.h.

◆ multiSelection

bool qMRMLSubjectHierarchyTreeView::multiSelection
readwrite

Flag determining whether multiple items can be selected.

Definition at line 66 of file qMRMLSubjectHierarchyTreeView.h.

◆ nameFilter

QString qMRMLSubjectHierarchyTreeView::nameFilter
readwrite

Definition at line 68 of file qMRMLSubjectHierarchyTreeView.h.

◆ nodeTypes

QStringList qMRMLSubjectHierarchyTreeView::nodeTypes
readwrite

Definition at line 69 of file qMRMLSubjectHierarchyTreeView.h.

◆ noneDisplay

QString qMRMLSubjectHierarchyTreeView::noneDisplay
readwrite

This property controls the name that is displayed for the None item. "None" by default.

See also
noneItemEnabled

Definition at line 85 of file qMRMLSubjectHierarchyTreeView.h.

◆ noneEnabled

bool qMRMLSubjectHierarchyTreeView::noneEnabled
readwrite

This property controls whether an extra item is added before any subject hierarchy item under the scene item for indicating 'None' selection.

Definition at line 81 of file qMRMLSubjectHierarchyTreeView.h.

◆ pluginAllowList

QStringList qMRMLSubjectHierarchyTreeView::pluginAllowList
readwrite

Definition at line 76 of file qMRMLSubjectHierarchyTreeView.h.

◆ pluginBlockList

QStringList qMRMLSubjectHierarchyTreeView::pluginBlockList
readwrite

Definition at line 77 of file qMRMLSubjectHierarchyTreeView.h.

◆ selectRoleSubMenuVisible

bool qMRMLSubjectHierarchyTreeView::selectRoleSubMenuVisible
readwrite

This property controls whether the Select role context menu sub-menu is visible. Visible by default.

Definition at line 64 of file qMRMLSubjectHierarchyTreeView.h.

◆ showRootItem

QVTK_OBJECTbool qMRMLSubjectHierarchyTreeView::showRootItem
readwrite

This property controls whether the root item (folder, an item for a data node, or the scene itself), if any is visible. When the root item is visible, it appears as a top-level item, if it is hidden only its children are top-level items. It doesn't have any effect if rootItem() is invalid. Shown by default.

See also
setShowRootItem(), showRootItem(), setRootItem(), setRootIndex()

Definition at line 52 of file qMRMLSubjectHierarchyTreeView.h.

◆ transformColumnVisible

bool qMRMLSubjectHierarchyTreeView::transformColumnVisible
readwrite

Definition at line 74 of file qMRMLSubjectHierarchyTreeView.h.

◆ useTerminologySelector

bool qMRMLSubjectHierarchyTreeView::useTerminologySelector
readwrite

Double-clicking the color will show a standard terminology selector if true, otherwise show simple color picker.

Definition at line 109 of file qMRMLSubjectHierarchyTreeView.h.

◆ visibilityColumnVisible

bool qMRMLSubjectHierarchyTreeView::visibilityColumnVisible
readwrite

Definition at line 71 of file qMRMLSubjectHierarchyTreeView.h.

Constructor & Destructor Documentation

◆ qMRMLSubjectHierarchyTreeView()

qMRMLSubjectHierarchyTreeView::qMRMLSubjectHierarchyTreeView ( QWidget * parent = nullptr)

◆ ~qMRMLSubjectHierarchyTreeView()

qMRMLSubjectHierarchyTreeView::~qMRMLSubjectHierarchyTreeView ( )
override

Member Function Documentation

◆ addItemAttributeFilter()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::addItemAttributeFilter ( QString attributeName,
QVariant attributeValue = QString(),
bool include = true )

Add single item attribute filter specifying attribute name, value, include/exclude, and class name

Parameters
attributeNameName of the item attribute to filter
attributeValueValue of the item attribute to filter
includeFlag indicating whether this is an include filter or exclude filter.
  • Include filter means that only the items are shown that match the filter.
  • Exclude filter hides items that match the filter. Overrides include filters. True by default (i.e. include filter).

◆ addNode [1/2]

virtual void qMRMLSubjectHierarchyTreeView::addNode ( )
protectedvirtualslot

◆ addNode [2/2]

virtual vtkMRMLNode * qMRMLSubjectHierarchyTreeView::addNode ( QString nodeType)
virtualslot

Creates a node of the same type as in the "node types" property.

Its name is generated using basename.

Returns
The new node or nullptr if nodeType is not among the allowed node types specified using setNodeTypes().
See also
nodeTypes()
baseName()

◆ addNodeAttributeFilter()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::addNodeAttributeFilter ( QString attributeName,
QVariant attributeValue = QString(),
bool include = true,
QString className = QString() )

Add single node attribute filter specifying attribute name, value, include/exclude, and class name

Parameters
attributeNameName of the node attribute to filter
attributeValueValue of the node attribute to filter
includeFlag indicating whether this is an include filter or exclude filter.
  • Include filter means that only the items are shown that match the filter.
  • Exclude filter hides items that match the filter. Overrides include filters. True by default (i.e. include filter).
classNameOnly filter attributes on a certain type. Empty by default (i.e. allow all classes)

◆ addNodeMenuActionVisible()

bool qMRMLSubjectHierarchyTreeView::addNodeMenuActionVisible ( ) const

Get whether the "Create node" actions are shown in the context menu of the scene.

◆ applyReferenceHighlightForItems()

void qMRMLSubjectHierarchyTreeView::applyReferenceHighlightForItems ( QList< vtkIdType > itemIDs)
protected

Apply highlight for subject hierarchy items referenced by argument items by DICOM

See also
highlightReferencedItems

◆ attributeNameFilter()

QString qMRMLSubjectHierarchyTreeView::attributeNameFilter ( ) const

◆ attributeValueFilter()

QString qMRMLSubjectHierarchyTreeView::attributeValueFilter ( ) const

◆ baseName()

QString qMRMLSubjectHierarchyTreeView::baseName ( const QString & nodeType = "") const

◆ changeEvent()

void qMRMLSubjectHierarchyTreeView::changeEvent ( QEvent * e)
overrideprotected

◆ clickDecoration()

virtual bool qMRMLSubjectHierarchyTreeView::clickDecoration ( QMouseEvent * e)
protectedvirtual

Handles clicks on the decoration of items (i.e. icon). In visibility column this means either toggle visibility or show visibility context menu.

Returns
True if decoration of an enabled item was indeed clicked (and event handled). False otherwise

◆ collapseItem

virtual void qMRMLSubjectHierarchyTreeView::collapseItem ( vtkIdType itemID)
virtualslot

Handle collapse item requests in the subject hierarchy tree. Collapses branch.

◆ colorColumnVisible()

bool qMRMLSubjectHierarchyTreeView::colorColumnVisible ( )

◆ contextMenuEnabled()

bool qMRMLSubjectHierarchyTreeView::contextMenuEnabled ( ) const

◆ currentItem()

Q_INVOKABLE vtkIdType qMRMLSubjectHierarchyTreeView::currentItem ( ) const

Get current (=selected) item. If there are multiple items selected, then the first one is returned.

◆ currentItemChanged

void qMRMLSubjectHierarchyTreeView::currentItemChanged ( vtkIdType )
signal

◆ currentItemModified

void qMRMLSubjectHierarchyTreeView::currentItemModified ( vtkIdType )
signal

◆ currentItems() [1/2]

QList< vtkIdType > qMRMLSubjectHierarchyTreeView::currentItems ( )

Get current (=selected) items.

◆ currentItems() [2/2]

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::currentItems ( vtkIdList * selectedItems)

Get current (=selected) items.

Parameters
vtkIdListfor python compatibility

◆ currentItemsChanged

void qMRMLSubjectHierarchyTreeView::currentItemsChanged ( QList< vtkIdType > )
signal

◆ currentNode()

virtual vtkMRMLNode * qMRMLSubjectHierarchyTreeView::currentNode ( ) const
virtual

Convenience method to set current item by associated data node.

◆ currentNodeChanged

void qMRMLSubjectHierarchyTreeView::currentNodeChanged ( vtkMRMLNode * )
signal

◆ deleteSelectedItems

void qMRMLSubjectHierarchyTreeView::deleteSelectedItems ( )
slot

Delete selected subject hierarchy items and associated data nodes.

◆ descriptionColumnVisible()

bool qMRMLSubjectHierarchyTreeView::descriptionColumnVisible ( )

◆ disablePlugin

void qMRMLSubjectHierarchyTreeView::disablePlugin ( QString plugin)
slot

Disable subject hierarchy plugin by adding it to the blocklist

See also
setPluginBlocklist
Parameters
pluginName of the plugin to disable

◆ displayedItemCount()

Q_INVOKABLE int qMRMLSubjectHierarchyTreeView::displayedItemCount ( ) const

Determine the number of shown items.

◆ editCurrentItem

virtual void qMRMLSubjectHierarchyTreeView::editCurrentItem ( )
virtualslot

Edit properties of current item.

◆ editMenuActionVisible()

bool qMRMLSubjectHierarchyTreeView::editMenuActionVisible ( ) const

◆ excludeItemAttributeNamesFilter()

QStringList qMRMLSubjectHierarchyTreeView::excludeItemAttributeNamesFilter ( ) const

◆ excludeNodeAttributeNamesFilter()

QStringList qMRMLSubjectHierarchyTreeView::excludeNodeAttributeNamesFilter ( ) const

◆ expandItem

virtual void qMRMLSubjectHierarchyTreeView::expandItem ( vtkIdType itemID)
virtualslot

Handle expand item requests in the subject hierarchy tree. Expands branch.

◆ findFirstNodeByClass()

Q_INVOKABLE vtkMRMLNode * qMRMLSubjectHierarchyTreeView::findFirstNodeByClass ( const QString & className) const

Finds the first node that is visible in the tree and is of the specified class (either exactly that class or it is a class derived from that class).

◆ firstSelectedSubjectHierarchyItemInBranch()

vtkIdType qMRMLSubjectHierarchyTreeView::firstSelectedSubjectHierarchyItemInBranch ( vtkIdType itemID)
protected

Return the id of the first subject hierarchy item that is found to be selected within the branch that has the input item id as its root

◆ hideChildNodeTypes()

QStringList qMRMLSubjectHierarchyTreeView::hideChildNodeTypes ( ) const

◆ hideSelectedItems

void qMRMLSubjectHierarchyTreeView::hideSelectedItems ( )
slot

Hide selected subject hierarchy items.

◆ highlightReferencedItems()

bool qMRMLSubjectHierarchyTreeView::highlightReferencedItems ( ) const

◆ idColumnVisible()

bool qMRMLSubjectHierarchyTreeView::idColumnVisible ( )

◆ includeItemAttributeNamesFilter()

QStringList qMRMLSubjectHierarchyTreeView::includeItemAttributeNamesFilter ( ) const

◆ includeNodeAttributeNamesFilter()

QStringList qMRMLSubjectHierarchyTreeView::includeNodeAttributeNamesFilter ( ) const

◆ keyPressEvent()

void qMRMLSubjectHierarchyTreeView::keyPressEvent ( QKeyEvent * e)
overrideprotected

Handle key press event.

◆ levelFilter()

QStringList qMRMLSubjectHierarchyTreeView::levelFilter ( ) const

◆ model()

Q_INVOKABLE qMRMLSubjectHierarchyModel * qMRMLSubjectHierarchyTreeView::model ( ) const

◆ mousePressEvent()

void qMRMLSubjectHierarchyTreeView::mousePressEvent ( QMouseEvent * e)
overrideprotected

Handle mouse press event.

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene * qMRMLSubjectHierarchyTreeView::mrmlScene ( ) const

◆ multiSelection()

bool qMRMLSubjectHierarchyTreeView::multiSelection ( )

Get whether multi-selection is enabled.

◆ nameFilter()

QString qMRMLSubjectHierarchyTreeView::nameFilter ( ) const

◆ nodeAddedByUser

void qMRMLSubjectHierarchyTreeView::nodeAddedByUser ( vtkMRMLNode * node)
signal

Signal emitted when node is added by the user.

◆ nodeTypeLabel()

Q_INVOKABLE QString qMRMLSubjectHierarchyTreeView::nodeTypeLabel ( const QString & nodeType) const

◆ nodeTypes()

QStringList qMRMLSubjectHierarchyTreeView::nodeTypes ( ) const

◆ noneDisplay()

QString qMRMLSubjectHierarchyTreeView::noneDisplay ( ) const

◆ noneEnabled()

bool qMRMLSubjectHierarchyTreeView::noneEnabled ( ) const

◆ onCustomContextMenu

void qMRMLSubjectHierarchyTreeView::onCustomContextMenu ( const QPoint & point)
protectedslot

◆ onItemCollapsed

virtual void qMRMLSubjectHierarchyTreeView::onItemCollapsed ( const QModelIndex & collapsedItemIndex)
protectedvirtualslot

Updates subject hierarchy item expanded property when item is collapsed.

◆ onItemExpanded

virtual void qMRMLSubjectHierarchyTreeView::onItemExpanded ( const QModelIndex & expandedItemIndex)
protectedvirtualslot

Updates subject hierarchy item expanded property when item is expanded.

◆ onMRMLSceneEndBatchProcess

virtual void qMRMLSubjectHierarchyTreeView::onMRMLSceneEndBatchProcess ( vtkObject * sceneObject)
protectedvirtualslot

Called when batch processing ends. Restores selection, which is lost when the hierarchy is rebuilt.

◆ onMRMLSceneEndClose

virtual void qMRMLSubjectHierarchyTreeView::onMRMLSceneEndClose ( vtkObject * sceneObject)
protectedvirtualslot

Called when scene close is finished. Hierarchy is cleared in that case.

◆ onMRMLSceneStartBatchProcess

virtual void qMRMLSubjectHierarchyTreeView::onMRMLSceneStartBatchProcess ( vtkObject * sceneObject)
protectedvirtualslot

Called when batch processing starts. Makes sure stored selection does not get emptied before restoring.

◆ onMRMLSceneStartClose

virtual void qMRMLSubjectHierarchyTreeView::onMRMLSceneStartClose ( vtkObject * sceneObject)
protectedvirtualslot

Called when scene close is started.

◆ onSelectionChanged

virtual void qMRMLSubjectHierarchyTreeView::onSelectionChanged ( const QItemSelection & selected,
const QItemSelection & deselected )
protectedvirtualslot

◆ onSubjectHierarchyItemModified

virtual void qMRMLSubjectHierarchyTreeView::onSubjectHierarchyItemModified ( vtkObject * caller,
void * callData )
protectedvirtualslot

Propagate item modified event.

◆ onSubjectHierarchyItemTransformModified

virtual void qMRMLSubjectHierarchyTreeView::onSubjectHierarchyItemTransformModified ( vtkObject * caller,
void * callData )
protectedvirtualslot

Propagate item transform modified event.

◆ pluginAllowList()

QStringList qMRMLSubjectHierarchyTreeView::pluginAllowList ( ) const

Get list of subject hierarchy plugins that are enabled. An empty allowlist means all plugins are enabled. That is the default.

◆ pluginBlockList()

QStringList qMRMLSubjectHierarchyTreeView::pluginBlockList ( ) const

Get list of subject hierarchy plugins that are disabled. An empty blocklist means all plugins are enabled. That is the default.

◆ populateContextMenuForItem()

virtual void qMRMLSubjectHierarchyTreeView::populateContextMenuForItem ( vtkIdType itemID)
protectedvirtual

Populate general context menu for given subject hierarchy item

Parameters
itemIDSubject hierarchy item ID of the item to show context menu for. It is only used to determine whether empty area or scene was clicked. If not, then use the current items vector so that multi-selection can also be handled.

◆ populateTransformContextMenuForItem()

virtual void qMRMLSubjectHierarchyTreeView::populateTransformContextMenuForItem ( vtkIdType itemID)
protectedvirtual

Populate transform context menu for given subject hierarchy item.

◆ populateVisibilityContextMenuForItem()

virtual void qMRMLSubjectHierarchyTreeView::populateVisibilityContextMenuForItem ( vtkIdType itemID)
protectedvirtual

Populate visibility context menu for given subject hierarchy item.

◆ removeAttributeFilter()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::removeAttributeFilter ( )

Remove item attribute filtering.

See also
setAttribute

◆ removeItemAttributeFilter() [1/2]

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::removeItemAttributeFilter ( QString attributeName,
bool include )

Remove all item attribute filters specifying a given attribute name and include flag.

◆ removeItemAttributeFilter() [2/2]

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::removeItemAttributeFilter ( QString attributeName,
QVariant attributeValue,
bool include )

Remove single item attribute filter specifying each attribute.

See also
addAttributeFilter

◆ removeNodeAttributeFilter() [1/2]

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::removeNodeAttributeFilter ( QString attributeName,
bool include )

Remove all node attribute filters specifying a given attribute name and include flag.

◆ removeNodeAttributeFilter() [2/2]

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::removeNodeAttributeFilter ( QString attributeName,
QVariant attributeValue,
bool include,
QString className )

Remove single node attribute filter specifying each attribute.

See also
addAttributeFilter

◆ renameCurrentItem

void qMRMLSubjectHierarchyTreeView::renameCurrentItem ( )
slot

Rename currently selected one item by popping up a dialog.

◆ resetColumnSizesToDefault

void qMRMLSubjectHierarchyTreeView::resetColumnSizesToDefault ( )
slot

Resets column sizes and size policies to default.

◆ rootItem()

Q_INVOKABLE vtkIdType qMRMLSubjectHierarchyTreeView::rootItem ( ) const

Get root item of the tree.

◆ selectPluginForCurrentItem

virtual void qMRMLSubjectHierarchyTreeView::selectPluginForCurrentItem ( )
virtualslot

Handle manual selection of a plugin as the new owner of a subject hierarchy node.

◆ selectRoleSubMenuVisible()

bool qMRMLSubjectHierarchyTreeView::selectRoleSubMenuVisible ( ) const

◆ setAddNodeMenuActionVisible

void qMRMLSubjectHierarchyTreeView::setAddNodeMenuActionVisible ( bool show)
slot

Set whether to show the "Create node" actions in the context menu of the scene.

◆ setAttributeFilter()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::setAttributeFilter ( const QString & attributeName,
const QVariant & attributeValue = QVariant() )

Set attribute filter that allows showing only items that have the specified attribute and their parents.

Parameters
attributeNameName of the attribute by which the items are filtered
attributeValueValue of the specified attribute that needs to match this given value in order for it to be shown. If empty, then existence of the attribute is enough to show. Empty by default

◆ setAttributeNameFilter

void qMRMLSubjectHierarchyTreeView::setAttributeNameFilter ( QString & filter)
slot

◆ setAttributeValueFilter

void qMRMLSubjectHierarchyTreeView::setAttributeValueFilter ( QString & filter)
slot

◆ setBaseName()

void qMRMLSubjectHierarchyTreeView::setBaseName ( const QString & baseName,
const QString & nodeType = "" )

BaseName is the name used to generate a node name for all the new created nodes. If nodeType is not specified for setBaseName() then base name is set for all already defined node types. If nodeType is not specified for baseName() then base name of the first node type is returned.

◆ setColorColumnVisible()

void qMRMLSubjectHierarchyTreeView::setColorColumnVisible ( bool visible)

Set color column visibility.

◆ setContextMenuEnabled

void qMRMLSubjectHierarchyTreeView::setContextMenuEnabled ( bool enabled)
slot

◆ setCurrentItem

virtual void qMRMLSubjectHierarchyTreeView::setCurrentItem ( vtkIdType itemID)
virtualslot

Set current (=selected) subject hierarchy item.

◆ setCurrentItems [1/2]

virtual void qMRMLSubjectHierarchyTreeView::setCurrentItems ( QList< vtkIdType > items)
virtualslot

Set current (=selected) subject hierarchy items.

◆ setCurrentItems [2/2]

virtual void qMRMLSubjectHierarchyTreeView::setCurrentItems ( vtkIdList * items)
virtualslot

Python compatibility function to set current (=selected) subject hierarchy items.

◆ setCurrentNode

virtual void qMRMLSubjectHierarchyTreeView::setCurrentNode ( vtkMRMLNode * node)
virtualslot

Convenience method to set current item by associated data node.

◆ setDescriptionColumnVisible()

void qMRMLSubjectHierarchyTreeView::setDescriptionColumnVisible ( bool visible)

Set description column visibility.

◆ setEditMenuActionVisible

void qMRMLSubjectHierarchyTreeView::setEditMenuActionVisible ( bool visible)
slot

◆ setExcludeItemAttributeNamesFilter

void qMRMLSubjectHierarchyTreeView::setExcludeItemAttributeNamesFilter ( QStringList filter)
slot

◆ setExcludeNodeAttributeNamesFilter

void qMRMLSubjectHierarchyTreeView::setExcludeNodeAttributeNamesFilter ( QStringList filter)
slot

◆ setHideChildNodeTypes()

void qMRMLSubjectHierarchyTreeView::setHideChildNodeTypes ( const QStringList & types)

Set child node types filter that allows hiding certain data node subclasses that would otherwise be accepted by the data node type filter. Show all data nodes if empty

◆ setHighlightReferencedItems

void qMRMLSubjectHierarchyTreeView::setHighlightReferencedItems ( bool highlightOn)
slot

◆ setIdColumnVisible()

void qMRMLSubjectHierarchyTreeView::setIdColumnVisible ( bool visible)

Set ID column visibility.

◆ setIncludeItemAttributeNamesFilter

void qMRMLSubjectHierarchyTreeView::setIncludeItemAttributeNamesFilter ( QStringList filter)
slot

◆ setIncludeNodeAttributeNamesFilter

void qMRMLSubjectHierarchyTreeView::setIncludeNodeAttributeNamesFilter ( QStringList filter)
slot

◆ setLevelFilter()

void qMRMLSubjectHierarchyTreeView::setLevelFilter ( QStringList & levelFilter)

Set level filter that allows showing only items at a specified level and their parents. Show all items if empty.

◆ setMRMLScene

virtual void qMRMLSubjectHierarchyTreeView::setMRMLScene ( vtkMRMLScene * scene)
virtualslot

Set MRML scene.

◆ setMultiSelection

virtual void qMRMLSubjectHierarchyTreeView::setMultiSelection ( bool multiSelectionOn)
virtualslot

Set multi-selection.

◆ setNameFilter()

void qMRMLSubjectHierarchyTreeView::setNameFilter ( QString & nameFilter)

Set name filter that allows showing only items containing a specified string (case-insensitive). Show all items if empty.

◆ setNodeTypeLabel()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::setNodeTypeLabel ( const QString & label,
const QString & nodeType )

NodeTypeLabel is the name displayed to the user as node type. By default the node's tag is used. Configuration is useful for cases when a more specific type name is preferred (e.g., instead of the generic "Create new SubjectHierarchy" option, a module can set up the widget to show "Create new Measurements"). If label is set to empty then the default label is used.

◆ setNodeTypes()

void qMRMLSubjectHierarchyTreeView::setNodeTypes ( const QStringList & types)

Set node type filter that allows showing only data nodes of a certain type. Show all data nodes if empty.

◆ setNoneDisplay

void qMRMLSubjectHierarchyTreeView::setNoneDisplay ( const QString & displayName)
slot

◆ setNoneEnabled

void qMRMLSubjectHierarchyTreeView::setNoneEnabled ( bool enable)
slot

◆ setPluginAllowList

void qMRMLSubjectHierarchyTreeView::setPluginAllowList ( QStringList allowlist)
slot

Set list of subject hierarchy plugins that are enabled.

Parameters
allowlistList of allowed subject hierarchy plugin names. An empty allowlist means all plugins are enabled. That is the default.

◆ setPluginAllowlist

void qMRMLSubjectHierarchyTreeView::setPluginAllowlist ( QStringList allowlist)
inlineslot

Deprecated. Use setPluginAllowList instead.

Definition at line 327 of file qMRMLSubjectHierarchyTreeView.h.

◆ setPluginBlacklist

void qMRMLSubjectHierarchyTreeView::setPluginBlacklist ( QStringList blocklist)
inlineslot

Deprecated. Use setPluginBlocklist instead.

Definition at line 345 of file qMRMLSubjectHierarchyTreeView.h.

◆ setPluginBlockList

void qMRMLSubjectHierarchyTreeView::setPluginBlockList ( QStringList blocklist)
slot

Set list of subject hierarchy plugins that are disabled.

Parameters
blocklistList of blocked subject hierarchy plugin names. An empty blocklist means all plugins are enabled. That is the default.

◆ setPluginBlocklist

void qMRMLSubjectHierarchyTreeView::setPluginBlocklist ( QStringList blocklist)
inlineslot

Deprecated. Use setPluginBlockList instead.

Definition at line 333 of file qMRMLSubjectHierarchyTreeView.h.

◆ setPluginWhitelist

void qMRMLSubjectHierarchyTreeView::setPluginWhitelist ( QStringList allowlist)
inlineslot

Deprecated. Use setPluginAllowlist instead.

Definition at line 339 of file qMRMLSubjectHierarchyTreeView.h.

◆ setRootItem

virtual void qMRMLSubjectHierarchyTreeView::setRootItem ( vtkIdType itemID)
virtualslot

Set subject hierarchy item to be the root in the shown tree.

◆ setSelectRoleSubMenuVisible

void qMRMLSubjectHierarchyTreeView::setSelectRoleSubMenuVisible ( bool visible)
slot

◆ setShowRootItem

void qMRMLSubjectHierarchyTreeView::setShowRootItem ( bool show)
slot

Set root item visibility.

◆ setSubjectHierarchyNode()

virtual void qMRMLSubjectHierarchyTreeView::setSubjectHierarchyNode ( vtkMRMLSubjectHierarchyNode * shNode)
protectedvirtual

Set the subject hierarchy node found in the given scene. Called only internally.

◆ setTransformColumnVisible()

void qMRMLSubjectHierarchyTreeView::setTransformColumnVisible ( bool visible)

Set transform column visibility.

◆ setUseTerminologySelector

void qMRMLSubjectHierarchyTreeView::setUseTerminologySelector ( bool useTerminologySelector)
slot

Set if standard terminologies are used for choosing segment name and color.

◆ setVisibilityColumnVisible()

void qMRMLSubjectHierarchyTreeView::setVisibilityColumnVisible ( bool visible)

Set visibility column visibility.

◆ showContextMenuHint

bool qMRMLSubjectHierarchyTreeView::showContextMenuHint ( bool visibility = false)
slot

Show hint to user about context menus

Parameters
visibilityTrue if visibility context menu hint is to be shown, false for general context menu. False by default
Returns
Flag indicating whether hint could be shown (i.e. there was an item in the tree is displayable)

◆ showRootItem()

bool qMRMLSubjectHierarchyTreeView::showRootItem ( ) const

Get root item visibility.

◆ showSelectedItems

void qMRMLSubjectHierarchyTreeView::showSelectedItems ( )
slot

Show selected subject hierarchy items.

◆ sortFilterProxyModel()

Q_INVOKABLE qMRMLSortFilterSubjectHierarchyProxyModel * qMRMLSubjectHierarchyTreeView::sortFilterProxyModel ( ) const

◆ subjectHierarchyNode()

Q_INVOKABLE vtkMRMLSubjectHierarchyNode * qMRMLSubjectHierarchyTreeView::subjectHierarchyNode ( ) const

Return the subject hierarchy node found in the current MRML scene. While the scene is closing, this method may return a null pointer.

◆ toggleVisibilityOfSelectedItems

void qMRMLSubjectHierarchyTreeView::toggleVisibilityOfSelectedItems ( )
slot

Toggle visibility of selected subject hierarchy items.

◆ transformColumnVisible()

bool qMRMLSubjectHierarchyTreeView::transformColumnVisible ( )

◆ updateRootItem

virtual void qMRMLSubjectHierarchyTreeView::updateRootItem ( )
protectedvirtualslot

Update root item to restore view (e.g. after tree was updated in the model from the subject hierarchy)

◆ updateSelectPluginActions

virtual void qMRMLSubjectHierarchyTreeView::updateSelectPluginActions ( )
virtualslot

Update select plugin actions. Is called when the plugin selection sub-menu is opened, and when the user manually changes the owner plugin of a node. It sets checked state and update confidence values in the select plugin actions in the node context menu for the currently selected node.

◆ useTerminologySelector()

bool qMRMLSubjectHierarchyTreeView::useTerminologySelector ( ) const

Returns true if standard terminologies are used for choosing color. If false then simple selectors are used.

◆ visibilityColumnVisible()

bool qMRMLSubjectHierarchyTreeView::visibilityColumnVisible ( )

Friends And Related Symbol Documentation

◆ qMRMLSubjectHierarchyComboBox

friend class qMRMLSubjectHierarchyComboBox
friend

Definition at line 454 of file qMRMLSubjectHierarchyTreeView.h.

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSubjectHierarchyTreeViewPrivate> qMRMLSubjectHierarchyTreeView::d_ptr
protected

Definition at line 449 of file qMRMLSubjectHierarchyTreeView.h.


The documentation for this class was generated from the following file: