Medical Imaging Interaction Toolkit  2023.12.99-63768887
Medical Imaging Interaction Toolkit
mitkLevelWindowPreset.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 mitkLevelWindowPreset_h
14 #define mitkLevelWindowPreset_h
15 
16 #include <MitkCoreExports.h>
17 #include <map>
18 #include <string>
19 #include <vtkXMLParser.h>
20 
21 namespace mitk
22 {
23  class MITKCORE_EXPORT LevelWindowPreset : public vtkXMLParser
24  {
25  public:
26  static LevelWindowPreset *New();
27  vtkTypeMacro(LevelWindowPreset, vtkXMLParser);
28 
29  bool LoadPreset();
30  bool LoadPreset(std::string fileName);
31  double getLevel(std::string name);
32  double getWindow(std::string window);
33  std::map<std::string, double> &getLevelPresets();
34  std::map<std::string, double> &getWindowPresets();
35  void newPresets(std::map<std::string, double> newLevel, std::map<std::string, double> newWindow);
36 
37  protected:
39  ~LevelWindowPreset() override;
40 
41  private:
42  //##Documentation
43  //## @brief method used in XLM-Reading; gets called when a start-tag is read
44  void StartElement(const char *elementName, const char **atts) override;
45 
46  // void saveXML(mitk::XMLWriter& xmlWriter);
47  void save();
48 
49  //##Documentation
50  //## @brief reads an XML-String-Attribute
51  std::string ReadXMLStringAttribut(std::string name, const char **atts);
52 
53  static const std::string PRESET;
54  std::map<std::string, double> m_Level;
55  std::map<std::string, double> m_Window;
56  std::string m_XmlFileName;
57  };
58 }
59 #endif
mitk::LevelWindowPreset
Definition: mitkLevelWindowPreset.h:23
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkCoreExports.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15