Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkColorBarAnnotation.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 mitkColorBarAnnotation_h
14 #define mitkColorBarAnnotation_h
15 
16 #include <MitkAnnotationExports.h>
18 #include <mitkVtkAnnotation.h>
19 #include <vtkLookupTable.h>
20 #include <vtkSmartPointer.h>
21 
22 class vtkScalarBarActor;
23 
24 namespace mitk
25 {
36  {
37  public:
40  {
41  public:
44 
46  itk::TimeStamp m_LastUpdateTime;
47 
52  };
53 
55  itkFactorylessNewMacro(Self);
56  itkCloneMacro(Self);
57 
62  void SetDrawAnnotations(bool annotations);
63 
68  bool GetDrawAnnotations() const;
69 
72 
75 
80  void SetOrientation(int orientation);
81 
86  int GetOrientation() const;
87 
92  void SetMaxNumberOfColors(int numberOfColors);
93 
98  int GetMaxNumberOfColors() const;
99 
104  void SetNumberOfLabels(int numberOfLabels);
105 
110  int GetNumberOfLabels() const;
111 
117 
123 
128  void SetDrawTickLabels(bool ticks);
129 
134  bool GetDrawTickLabels() const;
135 
140  void SetAnnotationTextScaling(bool scale);
141 
147 
148  protected:
151 
152  vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
153  void UpdateVtkAnnotation(BaseRenderer *renderer) override;
154 
156  explicit ColorBarAnnotation();
157 
160 
161  private:
164 
166  ColorBarAnnotation &operator=(const ColorBarAnnotation &);
167  };
168 
169 } // namespace mitk
170 #endif
#define MITKANNOTATION_EXPORT
Base class for mapper specific rendering resources.
Organizes the rendering process.
Per-renderer local storage for the scalar bar actor.
~LocalStorage()
Default destructor of the local storage.
vtkSmartPointer< vtkScalarBarActor > m_ScalarBarActor
The vtkScalarBarActor used for rendering.
LocalStorage()
Default constructor of the local storage.
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
Displays a configurable color bar (scalar bar) on the render window.
vtkProp * GetVtkProp(BaseRenderer *renderer) const override
Create the VTK prop representing this annotation.
void SetLookupTable(vtkSmartPointer< vtkLookupTable > table)
Set the lookup table used for the color mapping.
void UpdateVtkAnnotation(BaseRenderer *renderer) override
void SetAnnotationTextScaling(bool scale)
Enable or disable text scaling on the annotation.
bool GetDrawAnnotations() const
Query whether text annotations are drawn.
bool GetDrawTickLabels() const
Query whether tick labels are drawn.
void SetOrientationToHorizontal()
Set the color bar orientation to horizontal.
bool GetAnnotationTextScaling() const
Query whether annotation text scaling is enabled.
void SetOrientationToVertical()
Set the color bar orientation to vertical.
mitkClassMacro(ColorBarAnnotation, mitk::VtkAnnotation)
int GetMaxNumberOfColors() const
Get the maximum number of colors.
ColorBarAnnotation()
explicit constructor which disallows implicit conversions
void SetDrawAnnotations(bool annotations)
Enable or disable drawing of text annotations on the color bar.
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all LocalStorages for the render windows.
int GetOrientation() const
Get the current orientation.
void SetOrientation(int orientation)
Set the color bar orientation.
void SetDrawTickLabels(bool ticks)
Enable or disable drawing of tick labels.
vtkSmartPointer< vtkLookupTable > GetLookupTable() const
Get the current lookup table.
void SetNumberOfLabels(int numberOfLabels)
Set the number of labels displayed on the bar.
void SetMaxNumberOfColors(int numberOfColors)
Set the maximum number of colors in the bar.
~ColorBarAnnotation() override
virtual destructor in order to derive from this class
int GetNumberOfLabels() const
Get the number of labels.
Base class for all annotations that use the VTK framework for rendering.
Find image slices visible on a given plane.