Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef LEVELWINDOWPRESET_H_HEADER
18 #define LEVELWINDOWPRESET_H_HEADER
19 
20 #include <MitkCoreExports.h>
21 #include <map>
22 #include <string>
23 #include <vtkXMLParser.h>
24 
25 namespace mitk
26 {
27  class MITKCORE_EXPORT LevelWindowPreset : public vtkXMLParser
28  {
29  public:
30  static LevelWindowPreset *New();
31  vtkTypeMacro(LevelWindowPreset, vtkXMLParser);
32 
33  bool LoadPreset();
34  bool LoadPreset(std::string fileName);
35  double getLevel(std::string name);
36  double getWindow(std::string window);
37  std::map<std::string, double> &getLevelPresets();
38  std::map<std::string, double> &getWindowPresets();
39  void newPresets(std::map<std::string, double> newLevel, std::map<std::string, double> newWindow);
40 
41  protected:
44 
45  private:
46  //##Documentation
47  //## @brief method used in XLM-Reading; gets called when a start-tag is read
48  void StartElement(const char *elementName, const char **atts) override;
49 
50  // void saveXML(mitk::XMLWriter& xmlWriter);
51  void save();
52 
53  //##Documentation
54  //## @brief reads an XML-String-Attribute
55  std::string ReadXMLStringAttribut(std::string name, const char **atts);
56 
57  static const std::string PRESET;
58  std::map<std::string, double> m_Level;
59  std::map<std::string, double> m_Window;
60  std::string m_XmlFileName;
61  };
62 }
63 #endif
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.