Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPropertyListsXmlFileReaderAndWriter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkPropertyListsXmlFileReaderAndWriter_h
14 #define mitkPropertyListsXmlFileReaderAndWriter_h
15 
16 #include <mitkDataStorage.h>
17 
18 namespace tinyxml2
19 {
20  class XMLElement;
21 }
22 
23 namespace mitk
24 {
45  class PropertyListsXmlFileReaderAndWriter : public itk::Object
46  {
47  public:
53  static const char *GetPropertyListIdElementName();
54 
56  itkFactorylessNewMacro(Self);
57  itkCloneMacro(Self);
58 
70  bool WriteLists(const std::string &fileName,
71  const std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
72 
83  bool ReadLists(const std::string &fileName,
84  std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
85 
86  protected:
89 
90  bool PropertyFromXmlElem(std::string &name, mitk::BaseProperty::Pointer &prop, const tinyxml2::XMLElement *elem) const;
91  bool PropertyToXmlElem(const std::string &name, const mitk::BaseProperty *prop, tinyxml2::XMLElement *elem) const;
92  };
93 }
94 
95 #endif
Abstract base class for properties.
Reads and writes collections of named PropertyList objects to and from XML files.
mitkClassMacroItkParent(PropertyListsXmlFileReaderAndWriter, itk::Object)
bool PropertyFromXmlElem(std::string &name, mitk::BaseProperty::Pointer &prop, const tinyxml2::XMLElement *elem) const
static const char * GetPropertyListIdElementName()
Get the XML attribute name used for PropertyList identifiers.
bool WriteLists(const std::string &fileName, const std::map< std::string, mitk::PropertyList::Pointer > &_PropertyLists) const
Write a map of PropertyLists to an XML file.
bool ReadLists(const std::string &fileName, std::map< std::string, mitk::PropertyList::Pointer > &_PropertyLists) const
Read a map of PropertyLists from an XML file.
bool PropertyToXmlElem(const std::string &name, const mitk::BaseProperty *prop, tinyxml2::XMLElement *elem) const
Find image slices visible on a given plane.