Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLSubjectHierarchyLegacyNode.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6 Queen's University, Kingston, ON, Canada. All Rights Reserved.
7
8 See COPYRIGHT.txt
9 or http://www.slicer.org/copyright/copyright.txt for details.
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18 and was supported through the Applied Cancer Research Unit program of Cancer Care
19 Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20
21==============================================================================*/
22
23// .NAME vtkMRMLSubjectHierarchyLegacyNode
24// .SECTION
25// MRML node to represent legacy subject hierarchy node
26//
27
28#ifndef __vtkMRMLSubjectHierarchyLegacyNode_h
29#define __vtkMRMLSubjectHierarchyLegacyNode_h
30
31// MRML includes
33
34// STD includes
35#include <map>
36
54{
55public:
56 // Separator characters for (de)serializing the UID map
57 static const std::string SUBJECTHIERARCHY_UID_ITEM_SEPARATOR;
59
60public:
67 void PrintSelf(ostream& os, vtkIndent indent) override;
68
70
72 void ReadXMLAttributes(const char** atts) override;
73
75 void WriteXML(ostream& of, int indent) override;
76
78 void Copy(vtkMRMLNode *node) override;
79
81 const char* GetNodeTagName() override;
82
83public:
89 static vtkMRMLSubjectHierarchyLegacyNode* GetSubjectHierarchyLegacyNodeByUID(vtkMRMLScene* scene, const char* uidName, const char* uidValue);
90
97 static vtkMRMLSubjectHierarchyLegacyNode* GetSubjectHierarchyLegacyNodeByUIDList(vtkMRMLScene* scene, const char* uidName, const char* uidValue);
98
99public:
101 static void DeserializeUIDList(std::string uidListString, std::vector<std::string>& deserializedUIDList);
102
107 std::vector<vtkMRMLSubjectHierarchyLegacyNode*> GetSubjectHierarchyNodesReferencedByDICOM();
108
109public:
111 vtkSetStringMacro(Level);
113 vtkGetStringMacro(Level);
114
116 vtkSetStringMacro(OwnerPluginName);
118 vtkGetStringMacro(OwnerPluginName);
119
122 std::string GetUID(std::string uidName);
123
125 std::map<std::string, std::string> GetUIDs()const;
126
127protected:
129 char* Level{nullptr};
130
132 char* OwnerPluginName{nullptr};
133
136 std::map<std::string, std::string> UIDs;
137
138protected:
143};
144
145#endif
Abstract class representing a hierarchy member.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
Legacy subject hierarchy node to allow loading older MRML scenes.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void PrintSelf(ostream &os, vtkIndent indent) override
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.
std::vector< vtkMRMLSubjectHierarchyLegacyNode * > GetSubjectHierarchyNodesReferencedByDICOM()
static vtkMRMLSubjectHierarchyLegacyNode * GetSubjectHierarchyLegacyNodeByUIDList(vtkMRMLScene *scene, const char *uidName, const char *uidValue)
static vtkMRMLSubjectHierarchyLegacyNode * GetSubjectHierarchyLegacyNodeByUID(vtkMRMLScene *scene, const char *uidName, const char *uidValue)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
vtkMRMLSubjectHierarchyLegacyNode(const vtkMRMLSubjectHierarchyLegacyNode &)
static vtkMRMLSubjectHierarchyLegacyNode * New()
static const std::string SUBJECTHIERARCHY_UID_NAME_VALUE_SEPARATOR
void operator=(const vtkMRMLSubjectHierarchyLegacyNode &)
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Contour)
std::map< std::string, std::string > UIDs
std::map< std::string, std::string > GetUIDs() const
Get UID map for this subject hierarchy node.
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
std::string GetUID(std::string uidName)