Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
Medical Imaging Interaction Toolkit
mitkParamapPresetsParser.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 PARAMAPPRESETS_H_HEADER
14 #define PARAMAPPRESETS_H_HEADER
15 
16 #include <MitkDICOMPMExports.h>
17 #include <vtkXMLParser.h>
18 #include <map>
19 #include <string>
20 #include <vtkSetGet.h>
21 
22 
23 
24 namespace mitk {
25 
26 
27 class MITKDICOMPM_EXPORT ParamapPresetsParser : public vtkXMLParser
28 {
29 public:
30  struct Type
31  {
32  std::string codeValue;
33  std::string codeScheme;
34  Type() = default;
35  Type(std::string value, std::string scheme) : codeValue(value), codeScheme(scheme){}
36  };
37 
38  using ParamapPrestsType = std::map<std::string, Type>;
39  static ParamapPresetsParser *New();
40  vtkTypeMacro(ParamapPresetsParser,vtkXMLParser);
41 
42 
43 
44  bool LoadPreset();
45  bool LoadPreset(const std::string& fileName);
46  Type GetType(const std::string& name);
47  ParamapPrestsType const GetTypePresets();
48  void NewPresets(ParamapPrestsType & newType);
49 
50 
51 protected:
52  ParamapPresetsParser() = default;
53  ~ParamapPresetsParser() override = default;
54 
55 private:
56  //##Documentation
57  //## @brief method used in XLM-Reading; gets called when a start-tag is read
58  void StartElement (const char *elementName, const char **atts) override;
59 
60 
61  //##Documentation
62  //## @brief reads an XML-String-Attribute
63  std::string ReadXMLStringAttribute(const std::string& name, const char **atts);
64 
65  static const std::string PRESET;
66  static const std::string TYPE;
67  static const std::string CODE_VALUE;
68  static const std::string CODE_SCHEME;
69 
70  std::string m_presetName;
71  ParamapPrestsType m_Type;
72  std::string m_XmlFileName;
73 };
74 }
75 #endif
DataCollection - Class to facilitate loading/accessing structured data.
Type(std::string value, std::string scheme)
std::map< std::string, Type > ParamapPrestsType
#define MITKDICOMPM_EXPORT