Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkScalarBarOverlay.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 QmitkScalarBarOverlay_h
14 #define QmitkScalarBarOverlay_h
15 
16 #include <MitkQtOverlaysExports.h>
17 
18 // MITK-Stuff
19 #include <QmitkOverlay.h>
20 #include <mitkCommon.h>
21 #include <mitkPropertyList.h>
22 #include <QmitkScalarBar.h>
23 
42 {
43  Q_OBJECT
44 
45 public:
50  QmitkScalarBarOverlay(const char *id);
51 
54 
63  void GenerateData(mitk::PropertyList::Pointer pl) override;
64 
69  QSize GetNeededSize() override;
70 
71 protected:
80  void GetProperties(mitk::PropertyList::Pointer pl);
81 
86  void SetupCallback(mitk::BaseProperty::Pointer prop);
87 
95 
98 
100  mitk::BaseProperty::Pointer m_ObservedProperty;
101 
103  mitk::PropertyList::Pointer m_PropertyList;
104 
106  unsigned long m_ObserverTag;
107 };
108 
109 #endif
#define MITKQTOVERLAYS_EXPORT
Abstract base class for all Qt-based overlay widgets in MITK.
Definition: QmitkOverlay.h:55
Overlay displaying a scale bar in a render window.
void SetupCallback(mitk::BaseProperty::Pointer prop)
Sets up an ITK observer on the given property to auto-update the scale factor.
QSize GetNeededSize() override
Returns the current size of the scalar bar widget.
~QmitkScalarBarOverlay() override
Destructor. Removes the property observer.
mitk::BaseProperty::Pointer m_ObservedProperty
The observed property for automatic updates.
QmitkScalarBarOverlay(const char *id)
Constructor. Creates the internal QmitkScalarBar widget.
void SetScaleFactor()
Reads the scale factor property and applies it to the scalar bar.
void GetProperties(mitk::PropertyList::Pointer pl)
Reads visual properties (color) from the PropertyList and applies them.
QmitkScalarBar * m_ScalarBar
The internal QmitkScalarBar widget.
mitk::PropertyList::Pointer m_PropertyList
Cached PropertyList for property lookups.
unsigned long m_ObserverTag
ITK observer tag for the property modification callback.
void GenerateData(mitk::PropertyList::Pointer pl) override
Configures the scalar bar overlay from the given PropertyList.
A widget that draws a scale bar with subdivision lines for spatial reference.