Medical Imaging Interaction Toolkit  2024.06.00
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 mitkParamapPresetsParser_h
14 #define mitkParamapPresetsParser_h
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
mitk::ParamapPresetsParser::ParamapPrestsType
std::map< std::string, Type > ParamapPrestsType
Definition: mitkParamapPresetsParser.h:38
MITKDICOMPM_EXPORT
#define MITKDICOMPM_EXPORT
Definition: MitkDICOMPMExports.h:15
mitk::ParamapPresetsParser::Type::Type
Type(std::string value, std::string scheme)
Definition: mitkParamapPresetsParser.h:35
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ParamapPresetsParser::Type
Definition: mitkParamapPresetsParser.h:30
MitkDICOMPMExports.h
mitk::ParamapPresetsParser::Type::codeValue
std::string codeValue
Definition: mitkParamapPresetsParser.h:32
mitk::ParamapPresetsParser::Type::codeScheme
std::string codeScheme
Definition: mitkParamapPresetsParser.h:33
mitk::ParamapPresetsParser
Definition: mitkParamapPresetsParser.h:27