Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
vtkMitkLevelWindowFilter.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 vtkMitkLevelWindowFilter_h
14 #define vtkMitkLevelWindowFilter_h
15 
16 class vtkScalarsToColors;
17 class vtkPiecewiseFunction;
18 #include <vtkImageData.h>
19 #include <vtkThreadedImageAlgorithm.h>
20 
21 #include <MitkCoreExports.h>
33 class MITKCORE_EXPORT vtkMitkLevelWindowFilter : public vtkThreadedImageAlgorithm
34 {
35 public:
36  vtkTypeMacro(vtkMitkLevelWindowFilter, vtkThreadedImageAlgorithm);
37 
40 
46  vtkMTimeType GetMTime() override;
47 
53  vtkScalarsToColors *GetLookupTable();
54 
60  void SetLookupTable(vtkScalarsToColors *lookupTable);
61 
69  vtkPiecewiseFunction *GetOpacityPiecewiseFunction() { return m_OpacityFunction; }
70 
78  void SetOpacityPiecewiseFunction(vtkPiecewiseFunction *opacityFunction);
79 
85  void SetMinOpacity(double minOpacity);
86 
92  inline double GetMinOpacity() const;
93 
99  void SetMaxOpacity(double maxOpacity);
100 
106  inline double GetMaxOpacity() const;
107 
113  void SetClippingBounds(double *);
114 
115 protected:
118 
121 
131  void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int id) override;
132 
138  int RequestInformation(vtkInformation *request,
139  vtkInformationVector **inputVector,
140  vtkInformationVector *outputVector) override;
141  // /** Standard VTK filter method to apply the filter. See VTK documentation. Not used at the moment.*/
142  // void ExecuteInformation(vtkImageData *vtkNotUsed(inData), vtkImageData *vtkNotUsed(outData));
143 
144 private:
146  vtkScalarsToColors *m_LookupTable;
148  vtkPiecewiseFunction *m_OpacityFunction;
150  double m_MinOpacity;
152  double m_MaxOpacity;
153 
154  double m_ClippingBounds[4];
155 };
156 #endif
#define MITKCORE_EXPORT
Applies the gray-value or color/opacity level window to scalar or RGB(A) images.
static vtkMitkLevelWindowFilter * New()
Create a new instance of vtkMitkLevelWindowFilter.
vtkTypeMacro(vtkMitkLevelWindowFilter, vtkThreadedImageAlgorithm)
vtkMitkLevelWindowFilter()
Default constructor.
void SetMinOpacity(double minOpacity)
Set the lower window opacity for the alpha level window.
void SetClippingBounds(double *)
Set clipping bounds for the opaque part of the resliced 2D image.
void SetOpacityPiecewiseFunction(vtkPiecewiseFunction *opacityFunction)
Set the piecewise function used to map scalar values to the alpha component.
vtkScalarsToColors * GetLookupTable()
Get the lookup table for the RGB level window.
void SetMaxOpacity(double maxOpacity)
Set the upper window opacity for the alpha level window.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Standard VTK pipeline method to propagate output information.
double GetMaxOpacity() const
Get the upper window opacity for the alpha level window.
~vtkMitkLevelWindowFilter() override
Destructor.
vtkPiecewiseFunction * GetOpacityPiecewiseFunction()
Get the piecewise function used to map scalar values to the alpha component.
double GetMinOpacity() const
Get the lower window opacity for the alpha level window.
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int id) override
Threaded execution method that applies the level window to image data.
void SetLookupTable(vtkScalarsToColors *lookupTable)
Set the lookup table for the RGB level window.
vtkMTimeType GetMTime() override
Get the modification time, considering the lookup table's modification time.