Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends
qMRMLSubjectHierarchyTreeView Class Reference

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

Inheritance diagram for qMRMLSubjectHierarchyTreeView:
Inheritance graph
[legend]
Collaboration diagram for qMRMLSubjectHierarchyTreeView:
Collaboration graph
[legend]

Public Types

typedef QTreeView Superclass
 

Properties

bool contextMenuEnabled
 Flag determining whether context menu is enabled. More...
 
bool editMenuActionVisible
 This property controls whether the Edit properties context menu action is visible. Visible by default. More...
 
bool highlightReferencedItems
 
bool multiSelection
 Flag determining whether multiple items can be selected. More...
 
bool selectRoleSubMenuVisible
 This property controls whether the Select role context menu sub-menu is visible. Visible by default. More...
 
bool showRootItem
 

Public Slots

virtual void collapseItem (vtkIdType itemID)
 Handle collapse item requests in the subject hierarchy tree. Collapses branch. More...
 
void deleteSelectedItems ()
 Delete selected subject hierarchy items and associated data nodes. More...
 
void disablePlugin (QString plugin)
 
virtual void editCurrentItem ()
 Edit properties of current item. More...
 
virtual void expandItem (vtkIdType itemID)
 Handle expand item requests in the subject hierarchy tree. Expands branch. More...
 
void renameCurrentItem ()
 Rename currently selected one item by popping up a dialog. More...
 
virtual void selectPluginForCurrentItem ()
 Handle manual selection of a plugin as the new owner of a subject hierarchy node. More...
 
void setContextMenuEnabled (bool enabled)
 
virtual void setCurrentItem (vtkIdType itemID)
 Set current (=selected) subject hierarchy item. More...
 
virtual void setCurrentItems (QList< vtkIdType > items)
 Set current (=selected) subject hierarchy items. More...
 
virtual void setCurrentItems (vtkIdList *items)
 Python compatibility function to set current (=selected) subject hierarchy items. More...
 
virtual void setCurrentNode (vtkMRMLNode *node)
 Convenience method to set current item by associated data node. More...
 
void setEditMenuActionVisible (bool visible)
 
void setHighlightReferencedItems (bool highlightOn)
 
virtual void setMRMLScene (vtkMRMLScene *scene)
 Set MRML scene. More...
 
virtual void setMultiSelection (bool multiSelectionOn)
 Set multi-selection. More...
 
void setPluginBlacklist (QStringList blacklist)
 
void setPluginWhitelist (QStringList whitelist)
 
virtual void setRootItem (vtkIdType itemID)
 Set subject hierarchy item to be the root in the shown tree. More...
 
void setSelectRoleSubMenuVisible (bool visible)
 
void setShowRootItem (bool show)
 Set root item visibility. More...
 
bool showContextMenuHint (bool visibility=false)
 
void toggleVisibilityOfSelectedItems ()
 Toggle visibility of selected subject hierarchy items. More...
 
virtual void updateSelectPluginActions ()
 

Signals

void currentItemChanged (vtkIdType)
 
void currentItemModified (vtkIdType)
 

Public Member Functions

bool contextMenuEnabled () const
 
Q_INVOKABLE vtkIdType currentItem () const
 Get current (=selected) item. If there are multiple items selected, then the first one is returned. More...
 
QList< vtkIdType > currentItems ()
 Get current (=selected) items. More...
 
Q_INVOKABLE void currentItems (vtkIdList *selectedItems)
 
Q_INVOKABLE int displayedItemCount () const
 Determine the number of shown items. More...
 
bool editMenuActionVisible () const
 
bool highlightReferencedItems () const
 
Q_INVOKABLE qMRMLSubjectHierarchyModelmodel () const
 
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 
bool multiSelection ()
 Get whether multi-selection is enabled. More...
 
 qMRMLSubjectHierarchyTreeView (QWidget *parent=0)
 
Q_INVOKABLE void removeAttributeFilter ()
 Remove item attribute filtering. More...
 
Q_INVOKABLE vtkIdType rootItem () const
 Get root item of the tree. More...
 
bool selectRoleSubMenuVisible () const
 
Q_INVOKABLE void setAttributeFilter (const QString &attributeName, const QVariant &attributeValue=QVariant())
 
Q_INVOKABLE void setHideChildNodeTypes (const QStringList &types)
 
Q_INVOKABLE void setLevelFilter (QString &levelFilter)
 Set level filter that allows showing only items at a specified level and their parents. Show all items if empty. More...
 
Q_INVOKABLE void setNameFilter (QString &nameFilter)
 Set name filter that allows showing only items containing a specified string (case-insensitive). Show all items if empty. More...
 
Q_INVOKABLE 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. More...
 
bool showRootItem () const
 Get root item visibility. More...
 
Q_INVOKABLE qMRMLSortFilterSubjectHierarchyProxyModelsortFilterProxyModel () const
 
Q_INVOKABLE vtkMRMLSubjectHierarchyNodesubjectHierarchyNode () const
 
virtual ~qMRMLSubjectHierarchyTreeView ()
 

Protected Slots

virtual void expandToDepthFromContextMenu ()
 Expand tree to depth specified by the clicked context menu action. More...
 
virtual void onItemCollapsed (const QModelIndex &collapsedItemIndex)
 Updates subject hierarchy item expanded property when item is collapsed. More...
 
virtual void onItemExpanded (const QModelIndex &expandedItemIndex)
 Updates subject hierarchy item expanded property when item is expanded. More...
 
virtual void onMRMLSceneCloseEnded (vtkObject *sceneObject)
 Called when scene end is finished. Hierarchy is cleared in that case. More...
 
virtual void onMRMLSceneEndBatchProcess (vtkObject *sceneObject)
 Called when batch processing ends. Restores selection, which is lost when the hierarchy is rebuilt. More...
 
virtual void onMRMLSceneStartBatchProcess (vtkObject *sceneObject)
 Called when batch processing starts. Makes sure stored selection does not get emptied before restoring. More...
 
virtual void onSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 
virtual void onSubjectHierarchyItemModified (vtkObject *caller, void *callData)
 
virtual void updateRootItem ()
 

Protected Member Functions

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

Protected Attributes

QScopedPointer< qMRMLSubjectHierarchyTreeViewPrivate > d_ptr
 

Friends

class qMRMLSubjectHierarchyComboBox
 

Detailed Description

Definition at line 44 of file qMRMLSubjectHierarchyTreeView.h.

Member Typedef Documentation

◆ Superclass

Definition at line 68 of file qMRMLSubjectHierarchyTreeView.h.

Property Documentation

◆ contextMenuEnabled

bool qMRMLSubjectHierarchyTreeView::contextMenuEnabled
readwrite

Flag determining whether context menu is enabled.

Definition at line 59 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 61 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 57 of file qMRMLSubjectHierarchyTreeView.h.

◆ multiSelection

bool qMRMLSubjectHierarchyTreeView::multiSelection
readwrite

Flag determining whether multiple items can be selected.

Definition at line 65 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 63 of file qMRMLSubjectHierarchyTreeView.h.

◆ showRootItem

bool 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 53 of file qMRMLSubjectHierarchyTreeView.h.

Constructor & Destructor Documentation

◆ qMRMLSubjectHierarchyTreeView()

qMRMLSubjectHierarchyTreeView::qMRMLSubjectHierarchyTreeView ( QWidget *  parent = 0)

◆ ~qMRMLSubjectHierarchyTreeView()

virtual qMRMLSubjectHierarchyTreeView::~qMRMLSubjectHierarchyTreeView ( )
virtual

Member Function Documentation

◆ applyReferenceHighlightForItems()

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

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

See also
highlightReferencedItems

◆ 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.

◆ 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

◆ deleteSelectedItems

void qMRMLSubjectHierarchyTreeView::deleteSelectedItems ( )
slot

Delete selected subject hierarchy items and associated data nodes.

◆ disablePlugin

void qMRMLSubjectHierarchyTreeView::disablePlugin ( QString  plugin)
slot

Disable subject hierarchy plugin by adding it to the blacklist

See also
setPluginBlacklist
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

◆ expandItem

virtual void qMRMLSubjectHierarchyTreeView::expandItem ( vtkIdType  itemID)
virtualslot

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

◆ expandToDepthFromContextMenu

virtual void qMRMLSubjectHierarchyTreeView::expandToDepthFromContextMenu ( )
protectedvirtualslot

Expand tree to depth specified by the clicked context menu action.

◆ 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

◆ highlightReferencedItems()

bool qMRMLSubjectHierarchyTreeView::highlightReferencedItems ( ) const

◆ keyPressEvent()

virtual void qMRMLSubjectHierarchyTreeView::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Handle key press event.

◆ model()

Q_INVOKABLE qMRMLSubjectHierarchyModel* qMRMLSubjectHierarchyTreeView::model ( ) const

◆ mousePressEvent()

virtual void qMRMLSubjectHierarchyTreeView::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Handle mouse press event.

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qMRMLSubjectHierarchyTreeView::mrmlScene ( ) const

◆ multiSelection()

bool qMRMLSubjectHierarchyTreeView::multiSelection ( )

Get whether multi-selection is enabled.

◆ 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.

◆ onMRMLSceneCloseEnded

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

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

◆ onMRMLSceneEndBatchProcess

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

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

◆ onMRMLSceneStartBatchProcess

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

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

◆ 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 signal if the item or an item in its branch was selected in that treeview

◆ 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.

◆ 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

◆ renameCurrentItem

void qMRMLSubjectHierarchyTreeView::renameCurrentItem ( )
slot

Rename currently selected one item by popping up a dialog.

◆ 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

◆ 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

◆ 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.

◆ setEditMenuActionVisible

void qMRMLSubjectHierarchyTreeView::setEditMenuActionVisible ( bool  visible)
slot

◆ setHideChildNodeTypes()

Q_INVOKABLE 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

◆ setLevelFilter()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::setLevelFilter ( QString &  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()

Q_INVOKABLE void qMRMLSubjectHierarchyTreeView::setNameFilter ( QString &  nameFilter)

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

◆ setNodeTypes()

Q_INVOKABLE 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.

◆ setPluginBlacklist

void qMRMLSubjectHierarchyTreeView::setPluginBlacklist ( QStringList  blacklist)
slot

Set list of subject hierarchy plugins that are disabled.

Parameters
blacklistList of blacklisted subject hierarchy plugin names. Empty blacklist means all plugins are enabled. That is the default.

◆ setPluginWhitelist

void qMRMLSubjectHierarchyTreeView::setPluginWhitelist ( QStringList  whitelist)
slot

Set list of subject hierarchy plugins that are enabled.

Parameters
whitelistList of whitelisted subject hierarchy plugin names. Empty whitelist means all plugins are enabled. That is the default.

◆ 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.

◆ 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.

◆ sortFilterProxyModel()

Q_INVOKABLE qMRMLSortFilterSubjectHierarchyProxyModel* qMRMLSubjectHierarchyTreeView::sortFilterProxyModel ( ) const

◆ subjectHierarchyNode()

Q_INVOKABLE vtkMRMLSubjectHierarchyNode* qMRMLSubjectHierarchyTreeView::subjectHierarchyNode ( ) const

◆ toggleSubjectHierarchyItemVisibility()

void qMRMLSubjectHierarchyTreeView::toggleSubjectHierarchyItemVisibility ( vtkIdType  itemID)
protected

Toggle visibility for given subject hierarchy item.

◆ toggleVisibilityOfSelectedItems

void qMRMLSubjectHierarchyTreeView::toggleVisibilityOfSelectedItems ( )
slot

Toggle visibility of selected subject hierarchy items.

◆ 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.

Friends And Related Function Documentation

◆ qMRMLSubjectHierarchyComboBox

friend class qMRMLSubjectHierarchyComboBox
friend

Definition at line 255 of file qMRMLSubjectHierarchyTreeView.h.

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSubjectHierarchyTreeViewPrivate> qMRMLSubjectHierarchyTreeView::d_ptr
protected

Definition at line 250 of file qMRMLSubjectHierarchyTreeView.h.


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