GDCM  2.2.0
vtkImageMapToColors16.h
Go to the documentation of this file.
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: vtkImageMapToColors16.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 vtkImageMapToColors16 - map the input image through a lookup table
31 // .SECTION Description
32 // The vtkImageMapToColors16 filter will take an input image of any valid
33 // scalar type, and map the first component of the image through a
34 // lookup table. The result is an image of type VTK_UNSIGNED_CHAR.
35 // If the lookup table is not set, or is set to NULL, then the input
36 // data will be passed through if it is already of type VTK_UNSIGNED_CHAR.
37 
38 // .SECTION See Also
39 // vtkLookupTable vtkScalarsToColors
40 
41 #ifndef VTKIMAGEMAPTOCOLORS16_H
42 #define VTKIMAGEMAPTOCOLORS16_H
43 
44 
45 #include "vtkThreadedImageAlgorithm.h"
46 
47 class vtkScalarsToColors;
48 
49 class VTK_EXPORT vtkImageMapToColors16 : public vtkThreadedImageAlgorithm
50 {
51 public:
52  static vtkImageMapToColors16 *New();
53  vtkTypeRevisionMacro(vtkImageMapToColors16,vtkThreadedImageAlgorithm);
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
56  // Description:
57  // Set the lookup table.
58  virtual void SetLookupTable(vtkScalarsToColors*);
59  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
60 
61  // Description:
62  // Set the output format, the default is RGBA.
63  vtkSetMacro(OutputFormat,int);
64  vtkGetMacro(OutputFormat,int);
65  void SetOutputFormatToRGBA() { this->OutputFormat = VTK_RGBA; };
66  void SetOutputFormatToRGB() { this->OutputFormat = VTK_RGB; };
67  void SetOutputFormatToLuminanceAlpha() { this->OutputFormat = VTK_LUMINANCE_ALPHA; };
68  void SetOutputFormatToLuminance() { this->OutputFormat = VTK_LUMINANCE; };
69 
70  // Description:
71  // Set the component to map for multi-component images (default: 0)
72  vtkSetMacro(ActiveComponent,int);
73  vtkGetMacro(ActiveComponent,int);
74 
75  // Description:
76  // Use the alpha component of the input when computing the alpha component
77  // of the output (useful when converting monochrome+alpha data to RGBA)
78  vtkSetMacro(PassAlphaToOutput,int);
79  vtkBooleanMacro(PassAlphaToOutput,int);
80  vtkGetMacro(PassAlphaToOutput,int);
81 
82  // Description:
83  // We need to check the modified time of the lookup table too.
84  virtual unsigned long GetMTime();
85 
86 protected:
89 
90  virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
91 
92  void ThreadedRequestData(vtkInformation *request,
93  vtkInformationVector **inputVector,
94  vtkInformationVector *outputVector,
95  vtkImageData ***inData, vtkImageData **outData,
96  int extent[6], int id);
97 
98  virtual int RequestData(vtkInformation *request,
99  vtkInformationVector **inputVector,
100  vtkInformationVector *outputVector);
101 
102  vtkScalarsToColors *LookupTable;
104 
107 
109 private:
110  vtkImageMapToColors16(const vtkImageMapToColors16&); // Not implemented.
111  void operator=(const vtkImageMapToColors16&); // Not implemented.
112 };
113 
114 #endif

Generated on Wed Jun 13 2012 20:40:38 for GDCM by doxygen 1.8.1
SourceForge.net Logo