Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
Medical Imaging Interaction Toolkit
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 (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 MITKLEVELWINDOWMANAGER_H
14 #define MITKLEVELWINDOWMANAGER_H
15 
16 // mitk core
17 #include "mitkBaseProperty.h"
18 #include "mitkDataStorage.h"
20 
21 // c++
22 #include <map>
23 #include <utility>
24 
25 namespace mitk
26 {
49  class MITKCORE_EXPORT LevelWindowManager : public itk::Object
50  {
51  public:
52 
54  itkFactorylessNewMacro(Self);
55  itkCloneMacro(Self);
56 
57  void SetDataStorage(DataStorage *ds);
58  DataStorage *GetDataStorage();
59 
67  void SetAutoTopMostImage(bool autoTopMost, const DataNode *removedNode = nullptr);
75  void SetSelectedImages(bool selectedImagesMode, const DataNode *removedNode = nullptr);
76 
77  void RecalculateLevelWindowForSelectedComponent(const itk::EventObject&);
83  void Update(const itk::EventObject&);
91  void UpdateSelected(const itk::EventObject&);
97  void SetLevelWindowProperty(LevelWindowProperty::Pointer levelWindowProperty);
101  void SetLevelWindow(const LevelWindow &levelWindow);
107  LevelWindowProperty::Pointer GetLevelWindowProperty();
113  const LevelWindow &GetLevelWindow();
119  bool IsAutoTopMost();
125  bool IsSelectedImages();
131  void DataStorageAddedNode(const DataNode *n = nullptr);
138  void DataStorageRemovedNode(const DataNode *removedNode = nullptr);
142  void OnPropertyModified(const itk::EventObject &e);
148  Image *GetCurrentImage();
156  int GetNumberOfObservers();
157 
164  DataStorage::SetOfObjects::ConstPointer GetRelevantNodes();
165 
166  protected:
168  ~LevelWindowManager() override;
169 
173 
174  typedef std::pair<unsigned long, DataNode::Pointer> PropDataPair;
175  typedef std::map<PropDataPair, BaseProperty::Pointer> ObserverToPropertyValueMap;
177  ObserverToPropertyValueMap m_ObserverToVisibleProperty;
179  ObserverToPropertyValueMap m_ObserverToLayerProperty;
181  ObserverToPropertyValueMap m_ObserverToRenderingModeProperty;
183  ObserverToPropertyValueMap m_ObserverToDisplayedComponentProperty;
185  ObserverToPropertyValueMap m_ObserverToLevelWindowImageProperty;
187  ObserverToPropertyValueMap m_ObserverToSelectedProperty;
188 
191  void UpdateObservers();
193  void ClearPropObserverLists();
195  void CreatePropObserverLists();
196 
197  bool IgnoreNode(const DataNode* dataNode);
198 
202 
205  unsigned long m_ObserverTag;
207  unsigned long m_PropertyModifiedTag;
209  std::vector<DataNode::Pointer> m_RelevantDataNodes;
212  };
213 }
214 
215 #endif // MITKLEVELWINDOWMANAGER_H
Data management class that handles &#39;was created by&#39; relations.
#define MITKCORE_EXPORT
ObserverToPropertyValueMap m_ObserverToLevelWindowImageProperty
Map to hold observer IDs to every "imageForLevelWindow" property of DataNode&#39;s BaseProperty.
DataStorage::Pointer m_DataStorage
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:31
DataCollection - Class to facilitate loading/accessing structured data.
ObserverToPropertyValueMap m_ObserverToRenderingModeProperty
Map to hold observer IDs to every "Image Rendering.Mode" property of DataNode&#39;s BaseProperty.
std::pair< unsigned long, DataNode::Pointer > PropDataPair
ObserverToPropertyValueMap m_ObserverToLayerProperty
Map to hold observer IDs to every "layer" property of DataNode&#39;s BaseProperty.
The LevelWindow class Class to store level/window values.
ObserverToPropertyValueMap m_ObserverToDisplayedComponentProperty
Map to hold observer IDs to every "Image.Displayed Component" property of DataNode&#39;s BaseProperty...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Image class for storing images.
Definition: mitkImage.h:72
ObserverToPropertyValueMap m_ObserverToVisibleProperty
Map to hold observer IDs to every "visible" property of DataNode&#39;s BaseProperty.
LevelWindowProperty::Pointer m_LevelWindowProperty
Pointer to the LevelWindowProperty of the current image.
std::vector< DataNode::Pointer > m_RelevantDataNodes
Provides access to the LevelWindowProperty object and LevelWindow of the "current" image...
ObserverToPropertyValueMap m_ObserverToSelectedProperty
Map to hold observer IDs to every "selected" property of DataNode&#39;s BaseProperty. ...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
std::map< PropDataPair, BaseProperty::Pointer > ObserverToPropertyValueMap