Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkLevelWindowManager.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 mitkLevelWindowManager_h
18 #define mitkLevelWindowManager_h
19 
20 #include "mitkBaseProperty.h"
21 #include "mitkDataStorage.h"
23 #include <map>
24 #include <utility>
25 
26 namespace mitk
27 {
51  class MITKCORE_EXPORT LevelWindowManager : public itk::Object
52  {
53  public:
54  mitkClassMacroItkParent(LevelWindowManager, itk::Object) itkFactorylessNewMacro(Self) itkCloneMacro(Self)
55 
56  void SetDataStorage(DataStorage *ds);
58 
63  void SetAutoTopMostImage(bool autoTopMost, const DataNode *removedNode = nullptr);
64 
65  void RecaluclateLevelWindowForSelectedComponent(const itk::EventObject &);
66 
67  void Update(const itk::EventObject &e);
68 
72  void SetLevelWindowProperty(LevelWindowProperty::Pointer levelWindowProperty);
73 
75  void SetLevelWindow(const LevelWindow &levelWindow);
76 
78  const LevelWindow &GetLevelWindow();
79 
81  LevelWindowProperty::Pointer GetLevelWindowProperty();
82 
84  bool isAutoTopMost();
85 
92  void DataStorageAddedNode(const DataNode *n = nullptr);
93 
101  void DataStorageRemovedNode(const DataNode *removedNode = nullptr);
102 
104  void OnPropertyModified(const itk::EventObject &e);
105 
106  Image *GetCurrentImage();
107 
115  int GetNumberOfObservers();
116 
121  DataStorage::SetOfObjects::ConstPointer GetRelevantNodes();
122 
123  protected:
125  ~LevelWindowManager();
126 
128  LevelWindowProperty::Pointer m_LevelWindowProperty;
129  typedef std::pair<unsigned long, DataNode::Pointer> PropDataPair;
131 
132  ObserverToPropertyMap
133  m_PropObserverToNode;
134  ObserverToPropertyMap
135  m_PropObserverToNode2;
136  ObserverToPropertyMap m_PropObserverToNode3;
137  ObserverToPropertyMap
139  m_PropObserverToNode4;
140  ObserverToPropertyMap
142  m_PropObserverToNode5;
143 
145  void UpdateObservers();
146  void ClearPropObserverLists();
148  void CreatePropObserverLists();
149  const mitk::DataNode *m_NodeMarkedToDelete;
150 
152  bool m_AutoTopMost;
153  unsigned long m_ObserverTag;
154  bool m_IsObserverTagSet;
155  unsigned long m_PropertyModifiedTag;
156  Image *m_CurrentImage;
157  bool m_IsPropertyModifiedTagSet;
158  bool m_SettingImgForLvlWinProp;
159  };
160 }
161 #endif
Data management class that handles 'was created by' relations.
#define MITKCORE_EXPORT
The LevelWindowProperty class Property for the mitk::LevelWindow.
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
static mitk::DataStorage::Pointer GetDataStorage()
std::pair< unsigned long, DataNode::Pointer > PropDataPair
The LevelWindow class Class to store level/window values.
Abstract base class for properties.
mitk::DataStorage::Pointer m_DataStorage
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Image class for storing images.
Definition: mitkImage.h:76
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image...
std::map< PropDataPair, BaseProperty::Pointer > ObserverToPropertyMap
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66