Slicer  5.0
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 | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
qMRMLSortFilterSubjectHierarchyProxyModel Class Reference

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

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

Public Types

typedef QSortFilterProxyModel Superclass
 

Properties

QString attributeNameFilter
 
QString attributeValueFilter
 
QStringList excludeItemAttributeNamesFilter
 
QStringList excludeNodeAttributeNamesFilter
 
QStringList hideChildNodeTypes
 
vtkIdType hideItemsUnaffiliatedWithItemID
 
QStringList includeItemAttributeNamesFilter
 
QStringList includeNodeAttributeNamesFilter
 
QStringList levelFilter
 Filter to show only items of a certain level (and their parents). If empty, then show all. More...
 
QString nameFilter
 Filter to show only items that contain the string in their names. Empty by default. More...
 
QStringList nodeTypes
 
bool showEmptyHierarchyItems
 

Public Slots

void setAttributeNameFilter (QString filter)
 
void setAttributeValueFilter (QString filter)
 
void setExcludeItemAttributeNamesFilter (QStringList filterList)
 
void setExcludeNodeAttributeNamesFilter (QStringList filterList)
 
void setHideChildNodeTypes (const QStringList &types)
 
void setIncludeItemAttributeNamesFilter (QStringList filterList)
 
void setIncludeNodeAttributeNamesFilter (QStringList filterList)
 
void setLevelFilter (QStringList filter)
 
void setNameFilter (QString filter)
 
void setNodeTypes (const QStringList &types)
 

Public Member Functions

Q_INVOKABLE int acceptedItemCount (vtkIdType rootItemID=0) const
 
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())
 
QString attributeNameFilter () const
 
QString attributeValueFilter () const
 
QStringList excludeItemAttributeNamesFilter () const
 
QStringList excludeNodeAttributeNamesFilter () const
 
bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QStringList hideChildNodeTypes () const
 
vtkIdType hideItemsUnaffiliatedWithItemID () const
 
QStringList includeItemAttributeNamesFilter () const
 
QStringList includeNodeAttributeNamesFilter () const
 
Q_INVOKABLE QModelIndex indexFromSubjectHierarchyItem (vtkIdType itemID, int column=0) const
 Retrieve an index for a given a subject hierarchy item ID. More...
 
QStringList levelFilter () const
 
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 
QString nameFilter () const
 
QStringList nodeTypes () const
 
 qMRMLSortFilterSubjectHierarchyProxyModel (QObject *parent=nullptr)
 
Q_INVOKABLE void removeItemAttributeFilter (QString attributeName, QVariant attributeValue, bool include)
 Remove single item attribute filter specifying each attribute. More...
 
Q_INVOKABLE void removeItemAttributeFilter (QString attributeName, bool include)
 Remove all item attribute filters specifying a given attribute name and include flag. More...
 
Q_INVOKABLE void removeNodeAttributeFilter (QString attributeName, QVariant attributeValue, bool include, QString className)
 Remove single node attribute filter specifying each attribute. More...
 
Q_INVOKABLE void removeNodeAttributeFilter (QString attributeName, bool include)
 Remove all node attribute filters specifying a given attribute name and include flag. More...
 
void setHideItemsUnaffiliatedWithItemID (vtkIdType itemID)
 
void setShowEmptyHierarchyItems (bool show)
 
bool showEmptyHierarchyItems () const
 
Q_INVOKABLE vtkIdType subjectHierarchyItemFromIndex (const QModelIndex &index) const
 Retrieve the associated subject hierarchy item ID from a model index. More...
 
Q_INVOKABLE vtkMRMLSubjectHierarchyNodesubjectHierarchyNode () const
 
Q_INVOKABLE QModelIndex subjectHierarchySceneIndex () const
 Retrieve the index of the MRML scene (the root item) in the subject hierarchy tree. More...
 
 ~qMRMLSortFilterSubjectHierarchyProxyModel () override
 

Protected Types

enum  AcceptType { Reject = 0, Accept, AcceptDueToBeingParentOfAccepted }
 

Protected Member Functions

virtual AcceptType filterAcceptsItem (vtkIdType itemID, bool canAcceptIfAnyChildIsAccepted=true) const
 Filters items to decide which to display in the view. More...
 
QStandardItem * sourceItem (const QModelIndex &index) const
 

Protected Attributes

QScopedPointer< qMRMLSortFilterSubjectHierarchyProxyModelPrivate > d_ptr
 

Friends

class qMRMLSubjectHierarchyTreeView
 

Detailed Description

Definition at line 42 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

Member Typedef Documentation

◆ Superclass

Definition at line 98 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

Member Enumeration Documentation

◆ AcceptType

This enum type is used to describe the behavior of an item with regard to filtering:

  • Reject if the item should not be visible and has no chance of being visible.
  • Accept if the item should be visible and will always be.
  • AcceptDueToBeingParentOfAccepted if the item should not be visible based on the applied filters, but it is the parent of an accepted item, so the item needs to be shown to indicate hierarchy.
Enumerator
Reject 
Accept 
AcceptDueToBeingParentOfAccepted 

Definition at line 189 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

Property Documentation

◆ attributeNameFilter

QString qMRMLSortFilterSubjectHierarchyProxyModel::attributeNameFilter
readwrite

Filter to show only items that contain an attribute with this name. Empty by default Note: Deprecated, kept only for backwards compatibility. Sets and returns the first attribute in

See also
includeNodeAttributeNamesFilter

Definition at line 90 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ attributeValueFilter

QString qMRMLSortFilterSubjectHierarchyProxyModel::attributeValueFilter
readwrite

Filter to show only items that contain any 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 Note: Deprecated, kept only for backwards compatibility. Works consistently with the previous operation.

Definition at line 95 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ excludeItemAttributeNamesFilter

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::excludeItemAttributeNamesFilter
readwrite

Filter to hide items that contain any of the given attributes with this name. Empty by default. When setting it, all the include filters are overwritten. Overrides

See also
includeItemAttributeNamesFilter

Definition at line 82 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ excludeNodeAttributeNamesFilter

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::excludeNodeAttributeNamesFilter
readwrite

Filter to hide items for data nodes that contain any of the given attributes with this name. Empty by default. When setting it, all the include filters are overwritten. Overrides

See also
includeNodeAttributeNamesFilter

Definition at line 86 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ hideChildNodeTypes

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::hideChildNodeTypes
readwrite

This property controls the items to hide by MRML node type Any node of type nodeType are visible except the ones also of type hideChildNodeTypes. e.g.: nodeTypes = vtkMRMLVolumeNode, showChildNodeTypes = true, hideChildNodeTypes = vtkMRMLDiffusionWeightedVolumeNode -> all the nodes of type vtkMRMLScalarVolumeNode, vtkMRMLTensorVolumeNode, vtkMRMLDiffusionImageVolumeNode... (but not vtkMRMLDiffusionWeightedVolumeNode) will be visible.

Definition at line 71 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ hideItemsUnaffiliatedWithItemID

vtkIdType qMRMLSortFilterSubjectHierarchyProxyModel::hideItemsUnaffiliatedWithItemID
readwrite

This property controls whether items unaffiliated with a given subject hierarchy item are hidden or not. All the nodes are visible (invalid item ID - vtkMRMLSubjectHierarchyNode::INVALID_ITEM_ID) by default

Definition at line 51 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ includeItemAttributeNamesFilter

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::includeItemAttributeNamesFilter
readwrite

Filter to show only items that contain any of the given attributes with this name. Empty by default. When setting it, all the include filters are overwritten.

Definition at line 75 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ includeNodeAttributeNamesFilter

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::includeNodeAttributeNamesFilter
readwrite

Filter to show only items for data nodes that contain any of the given attributes with this name. Empty by default. When setting it, all the include filters are overwritten.

Definition at line 78 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ levelFilter

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::levelFilter
readwrite

Filter to show only items of a certain level (and their parents). If empty, then show all.

Definition at line 58 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ nameFilter

QString qMRMLSortFilterSubjectHierarchyProxyModel::nameFilter
readwrite

Filter to show only items that contain the string in their names. Empty by default.

Definition at line 48 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ nodeTypes

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::nodeTypes
readwrite

This property controls which items are visible. The MRML node class name must be provided. An empty list means all the nodes are visible (default).

Definition at line 62 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

◆ showEmptyHierarchyItems

bool qMRMLSortFilterSubjectHierarchyProxyModel::showEmptyHierarchyItems
readwrite

Show hierarchy items (items without data node such as patient/study/folder) that have no children to show according to the filters. This is most useful to in off state keep combobox content reasonable size for selecting data nodes. True by default.

Definition at line 56 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

Constructor & Destructor Documentation

◆ qMRMLSortFilterSubjectHierarchyProxyModel()

qMRMLSortFilterSubjectHierarchyProxyModel::qMRMLSortFilterSubjectHierarchyProxyModel ( QObject *  parent = nullptr)

◆ ~qMRMLSortFilterSubjectHierarchyProxyModel()

qMRMLSortFilterSubjectHierarchyProxyModel::~qMRMLSortFilterSubjectHierarchyProxyModel ( )
override

Member Function Documentation

◆ acceptedItemCount()

Q_INVOKABLE int qMRMLSortFilterSubjectHierarchyProxyModel::acceptedItemCount ( vtkIdType  rootItemID = 0) const

Determine the number of accepted (shown) items

Parameters
rootItemIDAncestor item of branch in which the accepted items are counted. If no item is given, then the scene item is used (all items)

◆ addItemAttributeFilter()

Q_INVOKABLE void qMRMLSortFilterSubjectHierarchyProxyModel::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).

◆ addNodeAttributeFilter()

Q_INVOKABLE void qMRMLSortFilterSubjectHierarchyProxyModel::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)

◆ attributeNameFilter()

QString qMRMLSortFilterSubjectHierarchyProxyModel::attributeNameFilter ( ) const

◆ attributeValueFilter()

QString qMRMLSortFilterSubjectHierarchyProxyModel::attributeValueFilter ( ) const

◆ excludeItemAttributeNamesFilter()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::excludeItemAttributeNamesFilter ( ) const

◆ excludeNodeAttributeNamesFilter()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::excludeNodeAttributeNamesFilter ( ) const

◆ filterAcceptsItem()

virtual AcceptType qMRMLSortFilterSubjectHierarchyProxyModel::filterAcceptsItem ( vtkIdType  itemID,
bool  canAcceptIfAnyChildIsAccepted = true 
) const
protectedvirtual

Filters items to decide which to display in the view.

◆ filterAcceptsRow()

bool qMRMLSortFilterSubjectHierarchyProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
override

Returns true if the item in the row indicated by the given sourceRow and sourceParent should be included in the model; otherwise returns false. This method test each item via filterAcceptsItem

◆ flags()

Qt::ItemFlags qMRMLSortFilterSubjectHierarchyProxyModel::flags ( const QModelIndex &  index) const
override

◆ hideChildNodeTypes()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::hideChildNodeTypes ( ) const

◆ hideItemsUnaffiliatedWithItemID()

vtkIdType qMRMLSortFilterSubjectHierarchyProxyModel::hideItemsUnaffiliatedWithItemID ( ) const

◆ includeItemAttributeNamesFilter()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::includeItemAttributeNamesFilter ( ) const

◆ includeNodeAttributeNamesFilter()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::includeNodeAttributeNamesFilter ( ) const

◆ indexFromSubjectHierarchyItem()

Q_INVOKABLE QModelIndex qMRMLSortFilterSubjectHierarchyProxyModel::indexFromSubjectHierarchyItem ( vtkIdType  itemID,
int  column = 0 
) const

Retrieve an index for a given a subject hierarchy item ID.

◆ levelFilter()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::levelFilter ( ) const

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qMRMLSortFilterSubjectHierarchyProxyModel::mrmlScene ( ) const

◆ nameFilter()

QString qMRMLSortFilterSubjectHierarchyProxyModel::nameFilter ( ) const

◆ nodeTypes()

QStringList qMRMLSortFilterSubjectHierarchyProxyModel::nodeTypes ( ) const

◆ removeItemAttributeFilter() [1/2]

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

Remove single item attribute filter specifying each attribute.

See also
addAttributeFilter

◆ removeItemAttributeFilter() [2/2]

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

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

◆ removeNodeAttributeFilter() [1/2]

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

Remove single node attribute filter specifying each attribute.

See also
addAttributeFilter

◆ removeNodeAttributeFilter() [2/2]

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

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

◆ setAttributeNameFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setAttributeNameFilter ( QString  filter)
slot

◆ setAttributeValueFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setAttributeValueFilter ( QString  filter)
slot

◆ setExcludeItemAttributeNamesFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setExcludeItemAttributeNamesFilter ( QStringList  filterList)
slot

◆ setExcludeNodeAttributeNamesFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setExcludeNodeAttributeNamesFilter ( QStringList  filterList)
slot

◆ setHideChildNodeTypes

void qMRMLSortFilterSubjectHierarchyProxyModel::setHideChildNodeTypes ( const QStringList &  types)
slot

◆ setHideItemsUnaffiliatedWithItemID()

void qMRMLSortFilterSubjectHierarchyProxyModel::setHideItemsUnaffiliatedWithItemID ( vtkIdType  itemID)

◆ setIncludeItemAttributeNamesFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setIncludeItemAttributeNamesFilter ( QStringList  filterList)
slot

◆ setIncludeNodeAttributeNamesFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setIncludeNodeAttributeNamesFilter ( QStringList  filterList)
slot

◆ setLevelFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setLevelFilter ( QStringList  filter)
slot

◆ setNameFilter

void qMRMLSortFilterSubjectHierarchyProxyModel::setNameFilter ( QString  filter)
slot

◆ setNodeTypes

void qMRMLSortFilterSubjectHierarchyProxyModel::setNodeTypes ( const QStringList &  types)
slot

◆ setShowEmptyHierarchyItems()

void qMRMLSortFilterSubjectHierarchyProxyModel::setShowEmptyHierarchyItems ( bool  show)

◆ showEmptyHierarchyItems()

bool qMRMLSortFilterSubjectHierarchyProxyModel::showEmptyHierarchyItems ( ) const

◆ sourceItem()

QStandardItem* qMRMLSortFilterSubjectHierarchyProxyModel::sourceItem ( const QModelIndex &  index) const
protected

◆ subjectHierarchyItemFromIndex()

Q_INVOKABLE vtkIdType qMRMLSortFilterSubjectHierarchyProxyModel::subjectHierarchyItemFromIndex ( const QModelIndex &  index) const

Retrieve the associated subject hierarchy item ID from a model index.

◆ subjectHierarchyNode()

Q_INVOKABLE vtkMRMLSubjectHierarchyNode* qMRMLSortFilterSubjectHierarchyProxyModel::subjectHierarchyNode ( ) const

◆ subjectHierarchySceneIndex()

Q_INVOKABLE QModelIndex qMRMLSortFilterSubjectHierarchyProxyModel::subjectHierarchySceneIndex ( ) const

Retrieve the index of the MRML scene (the root item) in the subject hierarchy tree.

Friends And Related Function Documentation

◆ qMRMLSubjectHierarchyTreeView

friend class qMRMLSubjectHierarchyTreeView
friend

Definition at line 207 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSortFilterSubjectHierarchyProxyModelPrivate> qMRMLSortFilterSubjectHierarchyProxyModel::d_ptr
protected

Definition at line 202 of file qMRMLSortFilterSubjectHierarchyProxyModel.h.


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