1 /*=========================================================================
2 
3   Program: GDCM (Grassroots DICOM). A DICOM library
4 
5   Copyright (c) 2006-2011 Mathieu Malaterre
6   All rights reserved.
7   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9      This software is distributed WITHOUT ANY WARRANTY; without even
10      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11      PURPOSE.  See the above copyright notice for more information.
12 
13 =========================================================================*/
14 /*=========================================================================
15 
16   Portions of this file are subject to the VTK Toolkit Version 3 copyright.
17 
18   Program:   Visualization Toolkit
19   Module:    $RCSfile: vtkImageMapToWindowLevelColors2.h,v $
20 
21   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
22   All rights reserved.
23   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
24 
25      This software is distributed WITHOUT ANY WARRANTY; without even
26      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
27      PURPOSE.  See the above copyright notice for more information.
28 
29 =========================================================================*/
30 // .NAME vtkImageMapToWindowLevelColors2 - map the input image through a lookup table and window / level it
31 // .SECTION Description
32 // The vtkImageMapToWindowLevelColors2 filter will take an input image of any
33 // valid scalar type, and map the first component of the image through a
34 // lookup table.  This resulting color will be modulated with value obtained
35 // by a window / level operation. The result is an image of type
36 // VTK_UNSIGNED_CHAR. If the lookup table is not set, or is set to NULL, then
37 // the input data will be passed through if it is already of type
38 // UNSIGNED_CHAR.
39 //
40 // .SECTION See Also
41 // vtkLookupTable vtkScalarsToColors
42 
43 #ifndef VTKIMAGEMAPTOWINDOWLEVELCOLORS2_H
44 #define VTKIMAGEMAPTOWINDOWLEVELCOLORS2_H
45 
46 #include "vtkImageMapToColors.h"
47 
48 class VTK_EXPORT vtkImageMapToWindowLevelColors2 : public vtkImageMapToColors
49 {
50 public:
51   static vtkImageMapToWindowLevelColors2 *New();
52   vtkTypeMacro(vtkImageMapToWindowLevelColors2,vtkImageMapToColors);
53   void PrintSelf(ostream& os, vtkIndent indent);
54 
55   // Description:
56   // Set / Get the Window to use -> modulation will be performed on the
57   // color based on (S - (L - W/2))/W where S is the scalar value, L is
58   // the level and W is the window.
59   vtkSetMacro( Window, double );
60   vtkGetMacro( Window, double );
61 
62   // Description:
63   // Set / Get the Level to use -> modulation will be performed on the
64   // color based on (S - (L - W/2))/W where S is the scalar value, L is
65   // the level and W is the window.
66   vtkSetMacro( Level, double );
67   vtkGetMacro( Level, double );
68 
69 protected:
70   vtkImageMapToWindowLevelColors2();
71   ~vtkImageMapToWindowLevelColors2();
72 
73   virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
74   void ThreadedRequestData(vtkInformation *request,
75                            vtkInformationVector **inputVector,
76                            vtkInformationVector *outputVector,
77                            vtkImageData ***inData, vtkImageData **outData,
78                            int extent[6], int id);
79   virtual int RequestData(vtkInformation *request,
80                           vtkInformationVector **inputVector,
81                           vtkInformationVector *outputVector);
82 
83   double Window;
84   double Level;
85 
86 private:
87   vtkImageMapToWindowLevelColors2(const vtkImageMapToWindowLevelColors2&);  // Not implemented.
88   void operator=(const vtkImageMapToWindowLevelColors2&);  // Not implemented.
89 };
90 
91 #endif
92