Slicer
5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
MRML node to represent a complete subject hierarchy tree. More...
#include <Libs/MRML/Core/vtkMRMLSubjectHierarchyNode.h>
Classes | |
struct | SubjectHierarchyItemsShowInViewRequestedEventData |
Public Member Functions | |
void | Copy (vtkMRMLNode *node) override |
Copy the node's attributes to this object. More... | |
vtkIdType | CreateFolderItem (vtkIdType parentItemID, std::string name) |
vtkIdType | CreateHierarchyItem (vtkIdType parentItemID, std::string name, std::string level, int positionUnderParent=-1) |
vtkIdType | CreateItem (vtkIdType parentItemID, vtkMRMLNode *dataNode, const char *ownerPluginName=nullptr) |
vtkMRMLNode * | CreateNodeInstance () override |
Create instance of the default node. Like New only virtual. More... | |
vtkIdType | CreateStudyItem (vtkIdType parentItemID, std::string name) |
vtkIdType | CreateSubjectItem (vtkIdType parentItemID, std::string name) |
std::string | GenerateUniqueItemName (std::string name) |
Generate unique item name. More... | |
std::string | GetAttributeFromItemAncestor (vtkIdType itemID, std::string attributeName, std::string level="") |
virtual const char * | GetClassName () |
void | GetDataNodesInBranch (vtkIdType itemID, vtkCollection *dataNodeCollection, const char *childClass=nullptr) |
vtkMRMLDisplayNode * | GetDisplayNodeForItem (vtkIdType itemID) |
int | GetDisplayVisibilityForBranch (vtkIdType itemID) |
vtkIdType | GetItemAncestorAtLevel (vtkIdType itemID, std::string level) |
std::string | GetItemAttribute (vtkIdType itemID, std::string attributeName) |
std::vector< std::string > | GetItemAttributeNames (vtkIdType itemID) |
vtkIdType | GetItemByDataNode (vtkMRMLNode *dataNode) |
vtkIdType | GetItemByName (std::string name) |
vtkIdType | GetItemByPositionUnderParent (vtkIdType parentItemID, int position) |
vtkIdType | GetItemByUID (const char *uidName, const char *uidValue) |
vtkIdType | GetItemByUIDList (const char *uidName, const char *uidValue) |
void | GetItemChildren (vtkIdType itemID, std::vector< vtkIdType > &childIDs, bool recursive=false) |
void | GetItemChildren (vtkIdType itemID, vtkIdList *childIDs, bool recursive=false) |
Python accessibility function to get children of a subject hierarchy item. More... | |
vtkIdType | GetItemChildWithName (vtkIdType parentItemID, std::string name, bool recursive=false) |
vtkMRMLNode * | GetItemDataNode (vtkIdType itemID) |
Get data node for a subject hierarchy item. More... | |
int | GetItemDisplayVisibility (vtkIdType itemID) |
Get subject hierarchy item visibility. More... | |
bool | GetItemExpanded (vtkIdType itemID) |
Get expanded flag for a subject hierarchy item. More... | |
std::string | GetItemLevel (vtkIdType itemID) |
Convenience function to get level attribute for a subject hierarchy item. More... | |
std::string | GetItemName (vtkIdType itemID) |
std::string | GetItemOwnerPluginName (vtkIdType itemID) |
Get owner plugin name (role) for a subject hierarchy item. More... | |
vtkIdType | GetItemParent (vtkIdType itemID) |
int | GetItemPositionUnderParent (vtkIdType itemID) |
void | GetItemsByName (std::string name, vtkIdList *foundItemIds, bool contains=false) |
std::vector< vtkIdType > | GetItemsReferencedFromItemByDICOM (vtkIdType itemID) |
void | GetItemsReferencedFromItemByDICOM (vtkIdType itemID, vtkIdList *referencingIdList) |
std::vector< vtkIdType > | GetItemsReferencingItemByDICOM (vtkIdType itemID) |
void | GetItemsReferencingItemByDICOM (vtkIdType itemID, vtkIdList *referencingIdList) |
std::string | GetItemUID (vtkIdType itemID, std::string uidName) |
const char * | GetNodeTagName () override |
Get node XML tag name (like Volume, Contour) More... | |
int | GetNumberOfItemChildren (vtkIdType itemID, bool recursive=false) |
int | GetNumberOfItems () |
Get number of items under the scene, excluding the scene. More... | |
vtkMRMLNode * | GetParentDataNode (vtkMRMLNode *dataNode, bool recursive=false) |
vtkIdType | GetSceneItemID () |
Get ID of root subject hierarchy item (which can be interpreted as the scene in terms of hierarchy) More... | |
bool | HasItemAttribute (vtkIdType itemID, std::string attributeName) |
virtual int | IsA (const char *type) |
bool | IsAnyNodeInBranchTransformed (vtkIdType itemID, bool includeParentItem=true, vtkMRMLTransformNode *exceptionNode=nullptr) |
bool | IsItemLevel (vtkIdType itemID, std::string level) |
bool | IsItemVirtualBranchParent (vtkIdType itemID) |
void | ItemModified (vtkIdType itemID) |
bool | MoveItem (vtkIdType itemID, vtkIdType beforeItemID) |
void | PrintItem (vtkIdType itemID, ostream &os, vtkIndent indent) |
Print subject hierarchy item info on stream. More... | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
virtual void | ReadItemFromXML (const char **atts) |
Read item from XML. More... | |
void | RemoveAllItems (bool removeDataNode=false) |
bool | RemoveItem (vtkIdType itemID, bool removeDataNode=true, bool recursive=true) |
bool | RemoveItemAttribute (vtkIdType itemID, std::string attributeName) |
bool | RemoveItemChildren (vtkIdType itemID, bool removeDataNodes=true, bool recursive=true) |
bool | ReparentItemByDataNode (vtkIdType itemID, vtkMRMLNode *newParentNode) |
void | RequestOwnerPluginSearch (vtkIdType itemID) |
void | RequestOwnerPluginSearch (vtkMRMLNode *dataNode) |
void | SetDisplayVisibilityForBranch (vtkIdType itemID, int visible) |
void | SetItemAttribute (vtkIdType itemID, std::string attributeName, std::string attributeValue) |
Add attribute to the subject hierarchy item. More... | |
void | SetItemDataNode (vtkIdType itemID, vtkMRMLNode *dataNode) |
void | SetItemDisplayVisibility (vtkIdType itemID, int visible) |
void | SetItemExpanded (vtkIdType itemID, bool expanded) |
Set expanded flag for a subject hierarchy item (only for internal use, do not set explicitly) More... | |
void | SetItemLevel (vtkIdType itemID, std::string level) |
Convenience function to set level attribute for a subject hierarchy item. More... | |
void | SetItemName (vtkIdType itemID, std::string name) |
Set name for a subject hierarchy item. More... | |
void | SetItemOwnerPluginName (vtkIdType itemID, std::string ownerPluginName) |
Set owner plugin name (role) for a subject hierarchy item. More... | |
void | SetItemParent (vtkIdType itemID, vtkIdType parentItemID, bool enableCircularCheck=true) |
void | SetItemUID (vtkIdType itemID, std::string uidName, std::string uidValue) |
Set UID to the subject hierarchy item. More... | |
void | ShowItemsInView (vtkIdList *itemIDs, vtkMRMLAbstractViewNode *viewNode) |
Show items in selected view (used for drag&drop of subject hierarchy items into the viewer) More... | |
void | WriteNodeBodyXML (ostream &of, int indent) override |
Write this node's body to a MRML file in XML format. More... | |
void | WriteXML (ostream &of, int indent) override |
Write this node's information to a MRML file in XML format. More... | |
Public Member Functions inherited from vtkMRMLNode | |
vtkMRMLNode * | AddAndObserveNodeReferenceID (const char *referenceRole, const char *referencedNodeID, vtkIntArray *events=nullptr) |
Add and observe a reference node from this node for a specific referenceRole. More... | |
vtkMRMLNode * | AddNodeReferenceID (const char *referenceRole, const char *referencedNodeID) |
Convenience method that adds a referencedNodeID at the end of the list. More... | |
void | AddNodeReferenceRole (const char *referenceRole, const char *mrmlAttributeName=nullptr, vtkIntArray *events=nullptr) |
Add a referenceRole. More... | |
virtual void | AddToSceneOff () |
virtual void | AddToSceneOn () |
virtual void | CopyContent (vtkMRMLNode *node, bool deepCopy=true) |
Copy node contents from another node of the same type. Does not copy node ID, Scene, Name, SingletonTag, HideFromEditors, AddToScene, UndoEnabled, and node references. If deepCopy is set to false then a shallow copy of bulk data (such as image or mesh data) could be made; copying may be faster but the node may share some data with the source node instead of creating an independent copy. More... | |
virtual void | CopyReferences (vtkMRMLNode *node) |
Copy the references of the node into this. More... | |
void | CopyWithScene (vtkMRMLNode *node) |
Copy everything (including Scene and ID) from another node of the same type. More... | |
void | DisableModifiedEventOff () |
void | DisableModifiedEventOn () |
virtual int | EndModify (int previousDisableModifiedEventState) |
End modifying the node. More... | |
virtual int | GetAddToScene () |
node added to MRML scene. More... | |
const char * | GetAttribute (const char *name) |
Get value of a name value pair attribute. More... | |
std::vector< std::string > | GetAttributeNames () |
Get all attribute names. More... | |
void | GetAttributeNames (vtkStringArray *attributeNames) |
Get all attribute names. Python-wrappable version. More... | |
virtual vtkIntArray * | GetContentModifiedEvents () |
int | GetCustomModifiedEventPending (int eventId) |
virtual char * | GetDescription () |
virtual int | GetDisableModifiedEvent () |
Turn on/off generating InvokeEvent for set macros. More... | |
virtual int | GetHideFromEditors () |
Describes if the node is hidden. More... | |
virtual char * | GetID () |
ID use by other nodes to reference this node in XML. More... | |
virtual int | GetInMRMLCallbackFlag () |
Flags to avoid event loops. More... | |
virtual int | GetModifiedEventPending () |
virtual char * | GetName () |
vtkMRMLNode * | GetNodeReference (const char *referenceRole) |
const char * | GetNodeReferenceID (const char *referenceRole) |
Utility function that returns the first node id for a specific referenceRole. More... | |
void | GetNodeReferenceIDs (const char *referenceRole, std::vector< const char *> &referencedNodeIDs) |
Return a list of the referenced node IDs. More... | |
void | GetNodeReferenceRoles (std::vector< std::string > &roles) |
void | GetNodeReferences (const char *referenceRole, std::vector< vtkMRMLNode *> &nodes) |
Return a list of the referenced nodes. More... | |
vtkMRMLNode * | GetNthNodeReference (const char *referenceRole, int n) |
Get referenced MRML node for a specific referenceRole. More... | |
const char * | GetNthNodeReferenceID (const char *referenceRole, int n) |
Return the string of the Nth node ID for a specific reference role. More... | |
const char * | GetNthNodeReferenceRole (int n) |
int | GetNumberOfNodeReferenceRoles () |
int | GetNumberOfNodeReferences (const char *referenceRole) |
Return the number of node IDs for a specific reference role (and nodes as they always have the same size). More... | |
virtual int | GetSaveWithScene () |
Save node with MRML scene. More... | |
virtual vtkMRMLScene * | GetScene () |
Get the scene this node has been added to. More... | |
virtual int | GetSelectable () |
Describes if the node is selectable. More... | |
virtual int | GetSelected () |
Get/Set for Selected. More... | |
virtual char * | GetSingletonTag () |
virtual const char * | GetTypeDisplayName () |
virtual bool | GetUndoEnabled () |
virtual bool | HasCopyContent () const |
Returns true if the class supports deep and shallow copying node content. More... | |
bool | HasNodeReferenceID (const char *referenceRole, const char *referencedNodeID) |
Return true if referencedNodeID is in the node ID list for a specific referenceRole. More... | |
virtual void | HideFromEditorsOff () |
virtual void | HideFromEditorsOn () |
virtual void | InvokeCustomModifiedEvent (int eventId, void *callData=nullptr) |
This method allows the node to compress events. More... | |
virtual int | InvokePendingModifiedEvent () |
Invokes any modified events that are pending . More... | |
bool | IsSingleton () |
void | Modified () override |
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent. More... | |
virtual void | OnNodeAddedToScene () |
void | PrintSelf (ostream &os, vtkIndent indent) override |
virtual void | ProcessChildNode (vtkMRMLNode *) |
Set dependencies between this node and a child node when parsing XML file. More... | |
virtual void | ProcessMRMLEvents (vtkObject *caller, unsigned long event, void *callData) |
Propagate events generated in mrml. More... | |
virtual void | ReadXMLAttributes (const char **atts) |
void | RemoveAttribute (const char *name) |
Remove attribute with the specified name. More... | |
void | RemoveNodeReferenceIDs (const char *referenceRole) |
Remove all node IDs and associated nodes for a specific referenceRole. More... | |
void | RemoveNthNodeReferenceID (const char *referenceRole, int n) |
Convenience method that removes the Nth node ID from the list. More... | |
virtual void | Reset (vtkMRMLNode *defaultNode) |
Reset node attributes to the initial state as defined in the constructor or the passed default node. More... | |
virtual void | SaveWithSceneOff () |
virtual void | SaveWithSceneOn () |
virtual void | SelectableOff () |
virtual void | SelectableOn () |
virtual void | SelectedOff () |
virtual void | SelectedOn () |
virtual void | SetAddToScene (int) |
void | SetAddToSceneNoModify (int value) |
vtkMRMLNode * | SetAndObserveNodeReferenceID (const char *referenceRole, const char *referencedNodeID, vtkIntArray *events=nullptr) |
Set and observe a reference node from this node for a specific referenceRole. More... | |
vtkMRMLNode * | SetAndObserveNthNodeReferenceID (const char *referenceRole, int n, const char *referencedNodeID, vtkIntArray *events=nullptr) |
Set and observe the Nth node ID for a specific reference role. More... | |
void | SetAttribute (const char *name, const char *value) |
Set a name value pair attribute. More... | |
virtual void | SetDescription (const char *) |
Text description of this node, to be set by the user. More... | |
void | SetDisableModifiedEvent (int onOff) |
virtual void | SetHideFromEditors (int) |
void | SetInMRMLCallbackFlag (int flag) |
virtual void | SetName (const char *) |
Name of this node, to be set by the user. More... | |
vtkMRMLNode * | SetNodeReferenceID (const char *referenceRole, const char *referencedNodeID) |
Set a reference to a node with specified nodeID from this node for a specific referenceRole. More... | |
vtkMRMLNode * | SetNthNodeReferenceID (const char *referenceRole, int n, const char *referencedNodeID) |
Set a N-th reference from this node with specified referencedNodeID for a specific referenceRole. More... | |
virtual void | SetSaveWithScene (int) |
virtual void | SetScene (vtkMRMLScene *scene) |
This method is for internal use only. Use AddNode method of vtkMRMLScene to add a node to the scene. More... | |
virtual void | SetSceneReferences () |
Update the references of the node to the scene. More... | |
virtual void | SetSelectable (int) |
virtual void | SetSelected (int) |
void | SetSingletonOff () |
void | SetSingletonOn () |
virtual void | SetSingletonTag (const char *) |
Tag that make this node a singleton in the scene. More... | |
virtual void | SetUndoEnabled (bool) |
virtual int | StartModify () |
Start modifying the node. Disable Modify events. More... | |
virtual void | UndoEnabledOff () |
virtual void | UndoEnabledOn () |
virtual void | UpdateReferenceID (const char *oldID, const char *newID) |
Update the stored reference to another node in the scene. More... | |
virtual void | UpdateReferences () |
The method should remove all pointers and observations to all nodes that are not in the scene anymore. More... | |
virtual void | UpdateScene (vtkMRMLScene *) |
const char * | URLDecodeString (const char *inString) |
Decode a URL string. More... | |
const char * | URLEncodeString (const char *inString) |
Encode a URL string. More... | |
std::string | XMLAttributeDecodeString (const std::string &inString) |
Decode an XML attribute string. More... | |
std::string | XMLAttributeEncodeString (const std::string &inString) |
Encode an XML attribute string (replaces special characters by code sequences) More... | |
Static Public Member Functions | |
static void | DeserializeUIDList (std::string uidListString, std::vector< std::string > &deserializedUIDList) |
Deserialize a UID list string (stored in the UID map) into a vector of UID strings. More... | |
static vtkIdType | GetInvalidItemID () |
Python accessor for the invalid ID. More... | |
static vtkMRMLSubjectHierarchyNode * | GetSubjectHierarchyNode (vtkMRMLScene *scene) |
static int | IsTypeOf (const char *type) |
static vtkMRMLSubjectHierarchyNode * | New () |
static vtkMRMLSubjectHierarchyNode * | ResolveSubjectHierarchy (vtkMRMLScene *scene) |
Ensure the consistency and validity of the SH node in the scene. More... | |
static vtkMRMLSubjectHierarchyNode * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLNode | |
static int | IsTypeOf (const char *type) |
static vtkMRMLNode * | SafeDownCast (vtkObject *o) |
Static Public Attributes | |
static const vtkIdType | INVALID_ITEM_ID |
static const std::string | SUBJECTHIERARCHY_NAME_VALUE_SEPARATOR |
static const std::string | SUBJECTHIERARCHY_SEPARATOR |
static const std::string | SUBJECTHIERARCHY_VERSION_ATTRIBUTE_NAME |
Protected Member Functions | |
void | operator= (const vtkMRMLSubjectHierarchyNode &) |
vtkMRMLSubjectHierarchyNode () | |
vtkMRMLSubjectHierarchyNode (const vtkMRMLSubjectHierarchyNode &) | |
~vtkMRMLSubjectHierarchyNode () override | |
Protected Member Functions inherited from vtkMRMLNode | |
virtual const char * | GetMRMLAttributeNameFromReferenceRole (const char *refRole) |
Return the mrml attribute name (if found) associated with a reference role. Return 0 otherwise. More... | |
virtual const char * | GetReferenceRoleFromMRMLAttributeName (const char *attName) |
Return the reference role (if found) associated with the attribute name found in a MRML scene file. Return 0 otherwise. More... | |
virtual char * | GetTempURLString () |
void | GetUpdatedReferencedNodeEventList (int &oldReferencedNodeUseCount, int &newReferencedNodeUseCount, vtkIntArray *oldConsolidatedEventList, vtkIntArray *newConsolidatedEventList, vtkMRMLNode *oldReferencedNode, vtkMRMLNode *newReferencedNode, vtkMRMLNodeReference *referenceToIgnore, vtkIntArray *newEvents) |
virtual void | InvalidateNodeReferences () |
virtual bool | IsReferenceRoleGeneric (const char *refRole) |
Return true if the reference role is generic (ends with '/') or false otherwise. More... | |
virtual void | OnNodeReferenceAdded (vtkMRMLNodeReference *reference) |
virtual void | OnNodeReferenceModified (vtkMRMLNodeReference *reference) |
Called when a referenced node pointer is modified. More... | |
virtual void | OnNodeReferenceRemoved (vtkMRMLNodeReference *reference) |
Called when a referenced node pointer is removed (set to nullptr). More... | |
void | operator= (const vtkMRMLNode &) |
void | ParseReferencesAttribute (const char *attValue, std::set< std::string > &references) |
void | RemoveInvalidReferences (const std::set< std::string > &validNodeIDs) |
virtual void | SetTempURLString (const char *) |
Get/Set the string used to manage encoding/decoding of strings/URLs with special characters. More... | |
vtkMRMLNode * | UpdateNodeReferenceEventObserver (vtkMRMLNode *oldReferencedNode, vtkMRMLNode *newReferencedNode, vtkIntArray *newEvents, vtkMRMLNodeReference *referenceToIgnore) |
virtual void | UpdateNodeReferences (const char *referenceRole=nullptr) |
virtual void | UpdateNthNodeReference (const char *referenceRole, int n) |
vtkMRMLNode () | |
vtkMRMLNode (const vtkMRMLNode &) | |
~vtkMRMLNode () override | |
critical to have a virtual destructor! More... | |
Static Protected Member Functions | |
static void | ItemEventCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Callback function for all events from the subject hierarchy items. More... | |
Static Protected Member Functions inherited from vtkMRMLNode | |
static void | MRMLCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Protected Attributes | |
vtkInternal * | Internal |
vtkSmartPointer< vtkCallbackCommand > | ItemEventCallbackCommand |
Command handling events from subject hierarchy items. More... | |
Protected Attributes inherited from vtkMRMLNode | |
int | AddToScene {1} |
AttributesType | Attributes |
vtkIntArray * | ContentModifiedEvents |
char * | Description {nullptr} |
int | HideFromEditors {0} |
char * | ID {nullptr} |
int | InMRMLCallbackFlag {0} |
Flag to avoid event loops More... | |
vtkCallbackCommand * | MRMLCallbackCommand |
Holders for MRML callbacks. More... | |
vtkObserverManager * | MRMLObserverManager |
char * | Name {nullptr} |
NodeReferenceEventsType | NodeReferenceEvents |
std::map< std::string, std::string > | NodeReferenceMRMLAttributeNames |
NodeReferencesType | NodeReferences |
int | SaveWithScene {true} |
vtkWeakPointer< vtkMRMLScene > | Scene |
int | Selectable {1} |
int | Selected {0} |
bool | UndoEnabled {false} |
Friends | |
class | vtkInternal |
Additional Inherited Members | |
Protected Types inherited from vtkMRMLNode | |
typedef std::map< std::string, std::string > | AttributesType |
typedef std::map< std::string, vtkSmartPointer< vtkIntArray > > | NodeReferenceEventsType |
typedef std::vector< vtkSmartPointer< vtkMRMLNodeReference > > | NodeReferenceListType |
typedef std::map< std::string, NodeReferenceListType > | NodeReferencesType |
MRML node to represent a complete subject hierarchy tree.
There can be only one such node in the scene, as subject hierarchy is to contain all the supported data nodes in the scene, so that the user can navigate the data loaded throughout the session. It is not singleton in either the common or the MRML sense, instead, the subject hierarchy logic makes sure that any added subject hierarchy nodes are merged in the first one, and if the last one is removed, a new one is created. The used subject hierarchy node can be accessed using the static function
The node entries are encapsulated in SubjectHierarchyItem classes, which contain the hierarchy information for the contained nodes, and represent the non-leaf nodes of the tree. Accessor functions can be used to get/set the properties of the individual items.
Definition at line 56 of file vtkMRMLSubjectHierarchyNode.h.
Definition at line 106 of file vtkMRMLSubjectHierarchyNode.h.
anonymous enum |
Enumerator | |
---|---|
SubjectHierarchyItemAddedEvent | |
SubjectHierarchyItemAboutToBeRemovedEvent | |
SubjectHierarchyItemRemovedEvent | |
SubjectHierarchyItemModifiedEvent | |
SubjectHierarchyItemDisplayModifiedEvent | |
SubjectHierarchyItemTransformModifiedEvent | |
SubjectHierarchyItemReparentedEvent | |
SubjectHierarchyItemUIDAddedEvent | Event invoked when UID is added to subject hierarchy item. Useful when using UIDs to find related nodes, and the nodes are loaded sequentially in unspecified order. |
SubjectHierarchyItemOwnerPluginSearchRequested | Event invoked when a subject hierarchy item or its data node changed in a way that will influence the best owner plugin. Typically invoked by
|
SubjectHierarchyStartResolveEvent | Event invoked when item resolving starts (e.g. after scene import) |
SubjectHierarchyEndResolveEvent | Event invoked when item resolving finished (e.g. after scene import) |
SubjectHierarchyItemsShowInViewRequestedEvent | Event invoked when showing of subject hierarchy items in a specific view is requested (processed by the widget classes, by delegating to the owner subject hierarchy plugin). For internal use only. Use vtkMRMLSubjectHierarchyNode::ShowItemsInView or qSlicerSubjectHierarchyPluginHandler::showItemsInView method to request view of subject hierarchy items in a view. |
Definition at line 68 of file vtkMRMLSubjectHierarchyNode.h.
|
protected |
|
overrideprotected |
|
protected |
|
overridevirtual |
Copy the node's attributes to this object.
Reimplemented from vtkMRMLNode.
vtkIdType vtkMRMLSubjectHierarchyNode::CreateFolderItem | ( | vtkIdType | parentItemID, |
std::string | name | ||
) |
Convenience function to create folder item in the hierarchy under a specified parent.
parentItemID | Parent item folder which the created item is inserted. If top-level then use |
name | Name of the item. Only used if there is no data node associated |
vtkIdType vtkMRMLSubjectHierarchyNode::CreateHierarchyItem | ( | vtkIdType | parentItemID, |
std::string | name, | ||
std::string | level, | ||
int | positionUnderParent = -1 |
||
) |
Generic function to create hierarchy items of given level. Convenience functions are available for frequently used levels
parentItemID | Parent item under which the created item is inserted. If top-level then use |
name | Name of the item. Only used if there is no data node associated |
level | Level of the hierarchy item. It will be stored as attribute ( |
positionUnderParent | Position of the item under the parent item. If set to -1 then it will be appended after the last item under the parent. |
vtkIdType vtkMRMLSubjectHierarchyNode::CreateItem | ( | vtkIdType | parentItemID, |
vtkMRMLNode * | dataNode, | ||
const char * | ownerPluginName = nullptr |
||
) |
Create subject hierarchy item for a data node. Can be used to add nodes that were not added automatically (e.g. private scene, HideFromEditors on, or exclude attribute set)
parentItemID | Parent item under which the created item is inserted. If top-level then use |
dataNode | Associated data MRML node |
|
overridevirtual |
Create instance of the default node. Like New only virtual.
Implements vtkMRMLNode.
vtkIdType vtkMRMLSubjectHierarchyNode::CreateStudyItem | ( | vtkIdType | parentItemID, |
std::string | name | ||
) |
Convenience function to create study item in the hierarchy under a specified parent.
parentItemID | Parent item under which the created item is inserted |
name | Name of the item. Only used if there is no data node associated |
vtkIdType vtkMRMLSubjectHierarchyNode::CreateSubjectItem | ( | vtkIdType | parentItemID, |
std::string | name | ||
) |
Convenience function to create subject item in the hierarchy under a specified parent.
parentItemID | Parent item under which the created item is inserted. If top-level then use |
name | Name of the item. Only used if there is no data node associated |
|
static |
Deserialize a UID list string (stored in the UID map) into a vector of UID strings.
std::string vtkMRMLSubjectHierarchyNode::GenerateUniqueItemName | ( | std::string | name | ) |
Generate unique item name.
std::string vtkMRMLSubjectHierarchyNode::GetAttributeFromItemAncestor | ( | vtkIdType | itemID, |
std::string | attributeName, | ||
std::string | level = "" |
||
) |
Get attribute value for a item from an upper level in the subject hierarchy
attributeName | Name of the requested attribute |
level | Level of the ancestor item we look for the attribute in (e.g. value of vtkMRMLSubjectHierarchyConstants::GetSubjectHierarchyLevelStudy()). If empty, then look all the way up to the subject and return first attribute found with specified name |
|
virtual |
Reimplemented from vtkMRMLNode.
void vtkMRMLSubjectHierarchyNode::GetDataNodesInBranch | ( | vtkIdType | itemID, |
vtkCollection * | dataNodeCollection, | ||
const char * | childClass = nullptr |
||
) |
Find all associated data nodes of a specified class in a branch of the hierarchy.
itemID | Parent item of the branch |
dataNodeCollection | Collection updated with the list of data nodes |
childClass | Name of the class we are looking for. nullptr returns associated data nodes of any kind |
vtkMRMLDisplayNode* vtkMRMLSubjectHierarchyNode::GetDisplayNodeForItem | ( | vtkIdType | itemID | ) |
Get display node associated to a given item, either directly (folder, study, etc.) or indirectly (displayable nodes with an associated display node)
int vtkMRMLSubjectHierarchyNode::GetDisplayVisibilityForBranch | ( | vtkIdType | itemID | ) |
Get subject hierarchy branch visibility
|
inlinestatic |
Python accessor for the invalid ID.
Definition at line 187 of file vtkMRMLSubjectHierarchyNode.h.
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemAncestorAtLevel | ( | vtkIdType | itemID, |
std::string | level | ||
) |
Get ancestor subject hierarchy item at a certain level
level | Level of the ancestor item we start searching. |
std::string vtkMRMLSubjectHierarchyNode::GetItemAttribute | ( | vtkIdType | itemID, |
std::string | attributeName | ||
) |
Get an attribute with a given name for a subject hierarchy item
std::vector<std::string> vtkMRMLSubjectHierarchyNode::GetItemAttributeNames | ( | vtkIdType | itemID | ) |
Get attribute names for a subject hierarchy item
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemByDataNode | ( | vtkMRMLNode * | dataNode | ) |
Get subject hierarchy item associated to a data MRML node
dataNode | The node for which we want the associated hierarchy node |
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemByName | ( | std::string | name | ) |
Get item in whole subject hierarchy by a given name
name | Name to find |
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemByPositionUnderParent | ( | vtkIdType | parentItemID, |
int | position | ||
) |
Get item under parent by position
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemByUID | ( | const char * | uidName, |
const char * | uidValue | ||
) |
Find subject hierarchy item according to a UID (by exact match)
uidName | UID string to lookup |
uidValue | UID string that needs to exactly match the UID string of the subject hierarchy item |
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemByUIDList | ( | const char * | uidName, |
const char * | uidValue | ||
) |
Find subject hierarchy item according to a UID (by containing). For example find UID in instance UID list
uidName | UID string to lookup |
uidValue | UID string that needs to be contained in the UID string of the subject hierarchy item |
void vtkMRMLSubjectHierarchyNode::GetItemChildren | ( | vtkIdType | itemID, |
std::vector< vtkIdType > & | childIDs, | ||
bool | recursive = false |
||
) |
Get IDs of the children of a subject hierarchy item
childIDs | Output vector containing the children. It will not contain the given item itself. The order of the items is depth-first, in a way that the child of an item in the vector always comes after the item. |
recursive | If false then collect direct children, if true then the whole branch. False by default |
void vtkMRMLSubjectHierarchyNode::GetItemChildren | ( | vtkIdType | itemID, |
vtkIdList * | childIDs, | ||
bool | recursive = false |
||
) |
Python accessibility function to get children of a subject hierarchy item.
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemChildWithName | ( | vtkIdType | parentItemID, |
std::string | name, | ||
bool | recursive = false |
||
) |
Get child subject hierarchy item with specific name
parent | Parent subject hierarchy item to start from |
name | Name to find |
recursive | Flag determining whether search is recursive or not. False by default |
vtkMRMLNode* vtkMRMLSubjectHierarchyNode::GetItemDataNode | ( | vtkIdType | itemID | ) |
Get data node for a subject hierarchy item.
int vtkMRMLSubjectHierarchyNode::GetItemDisplayVisibility | ( | vtkIdType | itemID | ) |
Get subject hierarchy item visibility.
bool vtkMRMLSubjectHierarchyNode::GetItemExpanded | ( | vtkIdType | itemID | ) |
Get expanded flag for a subject hierarchy item.
std::string vtkMRMLSubjectHierarchyNode::GetItemLevel | ( | vtkIdType | itemID | ) |
Convenience function to get level attribute for a subject hierarchy item.
std::string vtkMRMLSubjectHierarchyNode::GetItemName | ( | vtkIdType | itemID | ) |
Get name for a subject hierarchy item
std::string vtkMRMLSubjectHierarchyNode::GetItemOwnerPluginName | ( | vtkIdType | itemID | ) |
Get owner plugin name (role) for a subject hierarchy item.
vtkIdType vtkMRMLSubjectHierarchyNode::GetItemParent | ( | vtkIdType | itemID | ) |
Get ID of the parent of a subject hierarchy item
int vtkMRMLSubjectHierarchyNode::GetItemPositionUnderParent | ( | vtkIdType | itemID | ) |
Get position of item under its parent
void vtkMRMLSubjectHierarchyNode::GetItemsByName | ( | std::string | name, |
vtkIdList * | foundItemIds, | ||
bool | contains = false |
||
) |
Get items in whole subject hierarchy by a given name
name | Name to find |
foundItemIds | List of found items |
contains | Flag whether string containment is enough to determine match. True means a substring is searched (case insensitive), false means that the name needs to match exactly (case sensitive). False by default. |
std::vector<vtkIdType> vtkMRMLSubjectHierarchyNode::GetItemsReferencedFromItemByDICOM | ( | vtkIdType | itemID | ) |
Get subject hierarchy items that are referenced from a given item by DICOM. Finds the series items that contain the SOP instance UIDs that are listed in the attribute of this item containing the referenced SOP instance UIDs
void vtkMRMLSubjectHierarchyNode::GetItemsReferencedFromItemByDICOM | ( | vtkIdType | itemID, |
vtkIdList * | referencingIdList | ||
) |
Python compatibility method to get items that are referenced from a given item by DICOM.
std::vector<vtkIdType> vtkMRMLSubjectHierarchyNode::GetItemsReferencingItemByDICOM | ( | vtkIdType | itemID | ) |
Get subject hierarchy items that reference a given item by DICOM. Finds the series items that contain the SOP instance UID of the item among their referenced SOP instance UIDs.
void vtkMRMLSubjectHierarchyNode::GetItemsReferencingItemByDICOM | ( | vtkIdType | itemID, |
vtkIdList * | referencingIdList | ||
) |
Python compatibility method to get items that are referenced from a given item by DICOM.
std::string vtkMRMLSubjectHierarchyNode::GetItemUID | ( | vtkIdType | itemID, |
std::string | uidName | ||
) |
Get a UID with a given name
|
overridevirtual |
Get node XML tag name (like Volume, Contour)
Implements vtkMRMLNode.
int vtkMRMLSubjectHierarchyNode::GetNumberOfItemChildren | ( | vtkIdType | itemID, |
bool | recursive = false |
||
) |
Get number of children for an item
recursive | If true, then get total number of items in the branch, only direct children otherwise. False by default |
int vtkMRMLSubjectHierarchyNode::GetNumberOfItems | ( | ) |
Get number of items under the scene, excluding the scene.
vtkMRMLNode* vtkMRMLSubjectHierarchyNode::GetParentDataNode | ( | vtkMRMLNode * | dataNode, |
bool | recursive = false |
||
) |
Get data node associated to the parent of the item associated to a data node.
recursive | Flag determining whether only the direct parent is considered (false), or also further up in the tree (true). Default is false |
vtkIdType vtkMRMLSubjectHierarchyNode::GetSceneItemID | ( | ) |
Get ID of root subject hierarchy item (which can be interpreted as the scene in terms of hierarchy)
|
static |
Get the (practically) singleton subject hierarchy node from MRML scene. Merges subject hierarchy nodes if multiple found, and returns the merged one.
bool vtkMRMLSubjectHierarchyNode::HasItemAttribute | ( | vtkIdType | itemID, |
std::string | attributeName | ||
) |
Determine if a given attribute is present in an item. Especially useful if need to determine whether an attribute value is empty string or the attribute is missing
|
virtual |
Reimplemented from vtkMRMLNode.
bool vtkMRMLSubjectHierarchyNode::IsAnyNodeInBranchTransformed | ( | vtkIdType | itemID, |
bool | includeParentItem = true , |
||
vtkMRMLTransformNode * | exceptionNode = nullptr |
||
) |
Determine if any of the children of this item is transformed (has a parent transform applied), except for an optionally given node
includeParentItem | Determine whether the given item (the parent of the branch) should be included in the search. True by default |
exceptionNode | The function returns false if the only applied transform found is this specified node. |
bool vtkMRMLSubjectHierarchyNode::IsItemLevel | ( | vtkIdType | itemID, |
std::string | level | ||
) |
Determine if an item is of a certain level
level | Level to check |
bool vtkMRMLSubjectHierarchyNode::IsItemVirtualBranchParent | ( | vtkIdType | itemID | ) |
Determine whether a given item is the parent of a virtual branch (Items in virtual branches are invalid without the parent item, as they represent the item's data node's content, so they are removed automatically when the parent item of the virtual branch is removed)
|
static |
|
staticprotected |
Callback function for all events from the subject hierarchy items.
void vtkMRMLSubjectHierarchyNode::ItemModified | ( | vtkIdType | itemID | ) |
Invoke item modified event (that triggers per-item update in the views). Useful if a property of the item changes that does not originate in the subject hierarchy item (such as visibility or transform of data node)
bool vtkMRMLSubjectHierarchyNode::MoveItem | ( | vtkIdType | itemID, |
vtkIdType | beforeItemID | ||
) |
Move item within the same branch before given item
beforeItemID | Item to move given item before. If INVALID_ITEM_ID then insert to the end |
|
static |
|
protected |
void vtkMRMLSubjectHierarchyNode::PrintItem | ( | vtkIdType | itemID, |
ostream & | os, | ||
vtkIndent | indent | ||
) |
Print subject hierarchy item info on stream.
|
override |
|
virtual |
Read item from XML.
void vtkMRMLSubjectHierarchyNode::RemoveAllItems | ( | bool | removeDataNode = false | ) |
Remove all items from hierarchy
removeDataNode | Flag determining whether to remove associated data node from the scene if any. False by default, because as opposed to the method |
bool vtkMRMLSubjectHierarchyNode::RemoveItem | ( | vtkIdType | itemID, |
bool | removeDataNode = true , |
||
bool | recursive = true |
||
) |
Remove subject hierarchy item or branch from the tree
itemID | Item to remove |
removeDataNode | Flag determining whether to remove associated data node from the scene if any. On by default |
recursive | Flag determining whether to remove children recursively (the whole branch). On by default |
bool vtkMRMLSubjectHierarchyNode::RemoveItemAttribute | ( | vtkIdType | itemID, |
std::string | attributeName | ||
) |
Remove attribute from subject hierarchy item
bool vtkMRMLSubjectHierarchyNode::RemoveItemChildren | ( | vtkIdType | itemID, |
bool | removeDataNodes = true , |
||
bool | recursive = true |
||
) |
Remove child items of a subject hierarchy item
itemID | Parent of items to remove |
removeDataNodes | Flag determining whether to remove associated data nodes from the scene if any. On by default |
recursive | Flag determining whether to remove children recursively, or just the direct children. On by default |
bool vtkMRMLSubjectHierarchyNode::ReparentItemByDataNode | ( | vtkIdType | itemID, |
vtkMRMLNode * | newParentNode | ||
) |
Set new parent to a subject hierarchy item under item associated to specified data node
void vtkMRMLSubjectHierarchyNode::RequestOwnerPluginSearch | ( | vtkIdType | itemID | ) |
Invoke SubjectHierarchyItemOwnerPluginSearchRequested event for the item, which results in a search for owner plugin. Typically called after setting an attribute indicating a desired role for the item.
void vtkMRMLSubjectHierarchyNode::RequestOwnerPluginSearch | ( | vtkMRMLNode * | dataNode | ) |
Invoke SubjectHierarchyItemOwnerPluginSearchRequested event for a node in the scene, which results in a search for owner plugin. If the data node is not in the subject hierarchy yet then it will be added. Typically called after setting an attribute indicating a desired role for the item.
|
static |
Ensure the consistency and validity of the SH node in the scene.
|
static |
void vtkMRMLSubjectHierarchyNode::SetDisplayVisibilityForBranch | ( | vtkIdType | itemID, |
int | visible | ||
) |
Set subject hierarchy branch visibility
void vtkMRMLSubjectHierarchyNode::SetItemAttribute | ( | vtkIdType | itemID, |
std::string | attributeName, | ||
std::string | attributeValue | ||
) |
Add attribute to the subject hierarchy item.
void vtkMRMLSubjectHierarchyNode::SetItemDataNode | ( | vtkIdType | itemID, |
vtkMRMLNode * | dataNode | ||
) |
Set data node for a subject hierarchy item Note: This function is solely for setting nodes associated to hierarchy items (e.g. folder), and returns with error if a data node is already associated to the item. Does not call item modified event! This is due to simplicity reasons so that plugin search does not need to re-run when item is modified. Should never need to call manually!
void vtkMRMLSubjectHierarchyNode::SetItemDisplayVisibility | ( | vtkIdType | itemID, |
int | visible | ||
) |
Set subject hierarchy item visibility. If the item is a hierarchy item (folder, study, etc.), then it will apply to the whole branch, as the displayable managers consider hierarchy visibility information.
void vtkMRMLSubjectHierarchyNode::SetItemExpanded | ( | vtkIdType | itemID, |
bool | expanded | ||
) |
Set expanded flag for a subject hierarchy item (only for internal use, do not set explicitly)
void vtkMRMLSubjectHierarchyNode::SetItemLevel | ( | vtkIdType | itemID, |
std::string | level | ||
) |
Convenience function to set level attribute for a subject hierarchy item.
void vtkMRMLSubjectHierarchyNode::SetItemName | ( | vtkIdType | itemID, |
std::string | name | ||
) |
Set name for a subject hierarchy item.
void vtkMRMLSubjectHierarchyNode::SetItemOwnerPluginName | ( | vtkIdType | itemID, |
std::string | ownerPluginName | ||
) |
Set owner plugin name (role) for a subject hierarchy item.
void vtkMRMLSubjectHierarchyNode::SetItemParent | ( | vtkIdType | itemID, |
vtkIdType | parentItemID, | ||
bool | enableCircularCheck = true |
||
) |
Set the parent of a subject hierarchy item
enableCircularCheck | Option to do a safety check for circular parenthood in performance-critical cases. On by default. |
void vtkMRMLSubjectHierarchyNode::SetItemUID | ( | vtkIdType | itemID, |
std::string | uidName, | ||
std::string | uidValue | ||
) |
Set UID to the subject hierarchy item.
void vtkMRMLSubjectHierarchyNode::ShowItemsInView | ( | vtkIdList * | itemIDs, |
vtkMRMLAbstractViewNode * | viewNode | ||
) |
Show items in selected view (used for drag&drop of subject hierarchy items into the viewer)
|
overridevirtual |
Write this node's body to a MRML file in XML format.
Reimplemented from vtkMRMLNode.
|
overridevirtual |
Write this node's information to a MRML file in XML format.
Reimplemented from vtkMRMLNode.
|
friend |
Definition at line 426 of file vtkMRMLSubjectHierarchyNode.h.
|
protected |
Definition at line 424 of file vtkMRMLSubjectHierarchyNode.h.
|
static |
Definition at line 59 of file vtkMRMLSubjectHierarchyNode.h.
|
protected |
Command handling events from subject hierarchy items.
Definition at line 429 of file vtkMRMLSubjectHierarchyNode.h.
|
static |
Definition at line 63 of file vtkMRMLSubjectHierarchyNode.h.
|
static |
Definition at line 62 of file vtkMRMLSubjectHierarchyNode.h.
|
static |
Definition at line 66 of file vtkMRMLSubjectHierarchyNode.h.