GDCM 3.0.24
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 "vtkgdcmModule.h"
46#include "vtkThreadedImageAlgorithm.h"
47
48class vtkScalarsToColors;
49
50class VTKGDCM_EXPORT vtkImageMapToColors16 : public vtkThreadedImageAlgorithm
51{
52public:
54 vtkTypeMacro(vtkImageMapToColors16,vtkThreadedImageAlgorithm);
55 void PrintSelf(ostream& os, vtkIndent indent);
56
57 // Description:
58 // Set the lookup table.
59 virtual void SetLookupTable(vtkScalarsToColors*);
60 vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
61
62 // Description:
63 // Set the output format, the default is RGBA.
64 vtkSetMacro(OutputFormat,int);
65 vtkGetMacro(OutputFormat,int);
66 void SetOutputFormatToRGBA() { this->OutputFormat = VTK_RGBA; };
67 void SetOutputFormatToRGB() { this->OutputFormat = VTK_RGB; };
68 void SetOutputFormatToLuminanceAlpha() { this->OutputFormat = VTK_LUMINANCE_ALPHA; };
69 void SetOutputFormatToLuminance() { this->OutputFormat = VTK_LUMINANCE; };
70
71 // Description:
72 // Set the component to map for multi-component images (default: 0)
73 vtkSetMacro(ActiveComponent,int);
74 vtkGetMacro(ActiveComponent,int);
75
76 // Description:
77 // Use the alpha component of the input when computing the alpha component
78 // of the output (useful when converting monochrome+alpha data to RGBA)
79 vtkSetMacro(PassAlphaToOutput,int);
80 vtkBooleanMacro(PassAlphaToOutput,int);
81 vtkGetMacro(PassAlphaToOutput,int);
82
83 // Description:
84 // We need to check the modified time of the lookup table too.
85#ifdef VTK_HAS_MTIME_TYPE
86 virtual vtkMTimeType GetMTime();
87#else
88 virtual unsigned long GetMTime();
89#endif
90
91protected:
94
95 virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
96
97 void ThreadedRequestData(vtkInformation *request,
98 vtkInformationVector **inputVector,
99 vtkInformationVector *outputVector,
100 vtkImageData ***inData, vtkImageData **outData,
101 int extent[6], int id);
102
103 virtual int RequestData(vtkInformation *request,
104 vtkInformationVector **inputVector,
105 vtkInformationVector *outputVector);
106
107 vtkScalarsToColors *LookupTable;
109
112
114private:
115 vtkImageMapToColors16(const vtkImageMapToColors16&); // Not implemented.
116 void operator=(const vtkImageMapToColors16&); // Not implemented.
117};
118
119#endif
Definition vtkImageMapToColors16.h:51
void SetOutputFormatToLuminance()
Definition vtkImageMapToColors16.h:69
vtkGetObjectMacro(LookupTable, vtkScalarsToColors)
vtkGetMacro(PassAlphaToOutput, int)
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int id)
vtkGetMacro(OutputFormat, int)
vtkSetMacro(ActiveComponent, int)
vtkGetMacro(ActiveComponent, int)
virtual void SetLookupTable(vtkScalarsToColors *)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkScalarsToColors * LookupTable
Definition vtkImageMapToColors16.h:107
void SetOutputFormatToRGB()
Definition vtkImageMapToColors16.h:67
virtual unsigned long GetMTime()
vtkTypeMacro(vtkImageMapToColors16, vtkThreadedImageAlgorithm)
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetOutputFormatToRGBA()
Definition vtkImageMapToColors16.h:66
void SetOutputFormatToLuminanceAlpha()
Definition vtkImageMapToColors16.h:68
static vtkImageMapToColors16 * New()
vtkSetMacro(OutputFormat, int)
vtkBooleanMacro(PassAlphaToOutput, int)
int OutputFormat
Definition vtkImageMapToColors16.h:108
int PassAlphaToOutput
Definition vtkImageMapToColors16.h:111
void PrintSelf(ostream &os, vtkIndent indent)
vtkSetMacro(PassAlphaToOutput, int)
int DataWasPassed
Definition vtkImageMapToColors16.h:113
int ActiveComponent
Definition vtkImageMapToColors16.h:110