Medical Imaging Interaction Toolkit  2025.12.02
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 
39 
40  vtkMTimeType GetMTime() override;
42  vtkScalarsToColors *GetLookupTable();
44  void SetLookupTable(vtkScalarsToColors *lookupTable);
45 
48  vtkPiecewiseFunction *GetOpacityPiecewiseFunction() { return m_OpacityFunction; }
51  void SetOpacityPiecewiseFunction(vtkPiecewiseFunction *opacityFunction);
52 
54  void SetMinOpacity(double minOpacity);
55  inline double GetMinOpacity() const;
56 
58  void SetMaxOpacity(double maxOpacity);
59  inline double GetMaxOpacity() const;
60 
62  void SetClippingBounds(double *);
63 
64 protected:
76  void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int id) override;
77 
78  // /** Standard VTK filter method to apply the filter. See VTK documentation.*/
79  int RequestInformation(vtkInformation *request,
80  vtkInformationVector **inputVector,
81  vtkInformationVector *outputVector) override;
82  // /** Standard VTK filter method to apply the filter. See VTK documentation. Not used at the moment.*/
83  // void ExecuteInformation(vtkImageData *vtkNotUsed(inData), vtkImageData *vtkNotUsed(outData));
84 
85 private:
87  vtkScalarsToColors *m_LookupTable;
89  vtkPiecewiseFunction *m_OpacityFunction;
91  double m_MinOpacity;
93  double m_MaxOpacity;
94 
95  double m_ClippingBounds[4];
96 };
97 #endif
#define MITKCORE_EXPORT
Applies the grayvalue or color/opacity level window to scalar or RGB(A) images.
static vtkMitkLevelWindowFilter * New()
vtkTypeMacro(vtkMitkLevelWindowFilter, vtkThreadedImageAlgorithm)
void SetMinOpacity(double minOpacity)
Get/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 to alpha component value (only used when the lookupTabl...
vtkScalarsToColors * GetLookupTable()
Get the lookup table for the RGB level window.
void SetMaxOpacity(double maxOpacity)
Get/Set the upper window opacity for the alpha level window.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
double GetMaxOpacity() const
~vtkMitkLevelWindowFilter() override
vtkPiecewiseFunction * GetOpacityPiecewiseFunction()
Get the piecewise function used to map scalar to alpha component value (only used when the lookupTabl...
double GetMinOpacity() const
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int id) override
Method for threaded execution of the filter.
void SetLookupTable(vtkScalarsToColors *lookupTable)
Set the lookup table for the RGB level window.
vtkMTimeType GetMTime() override