GDCM 3.2.1

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
48 class vtkScalarsToColors;
49
50 class VTKGDCM_EXPORT vtkImageMapToColors16 : public vtkThreadedImageAlgorithm
51{
52 public:
53 static vtkImageMapToColors16 *New();
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
91 protected:
92 vtkImageMapToColors16();
93 ~vtkImageMapToColors16();
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;
108 int OutputFormat;
109
110 int ActiveComponent;
111 int PassAlphaToOutput;
112
113 int DataWasPassed;
114 private:
115 vtkImageMapToColors16(const vtkImageMapToColors16&); // Not implemented.
116 void operator=(const vtkImageMapToColors16&); // Not implemented.
117};
118
119#endif
vtkImageMapToColors16::SetOutputFormatToLuminance
void SetOutputFormatToLuminance()
Definition vtkImageMapToColors16.h:69
vtkImageMapToColors16::vtkGetObjectMacro
vtkGetObjectMacro(LookupTable, vtkScalarsToColors)
vtkImageMapToColors16::~vtkImageMapToColors16
~vtkImageMapToColors16()
vtkImageMapToColors16::vtkGetMacro
vtkGetMacro(PassAlphaToOutput, int)
vtkImageMapToColors16::ThreadedRequestData
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int id)
vtkImageMapToColors16::vtkGetMacro
vtkGetMacro(OutputFormat, int)
vtkImageMapToColors16::vtkSetMacro
vtkSetMacro(ActiveComponent, int)
vtkImageMapToColors16::vtkGetMacro
vtkGetMacro(ActiveComponent, int)
vtkImageMapToColors16::SetLookupTable
virtual void SetLookupTable(vtkScalarsToColors *)
vtkImageMapToColors16::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkImageMapToColors16::LookupTable
vtkScalarsToColors * LookupTable
Definition vtkImageMapToColors16.h:107
vtkImageMapToColors16::SetOutputFormatToRGB
void SetOutputFormatToRGB()
Definition vtkImageMapToColors16.h:67
vtkImageMapToColors16::GetMTime
virtual unsigned long GetMTime()
vtkImageMapToColors16::vtkTypeMacro
vtkTypeMacro(vtkImageMapToColors16, vtkThreadedImageAlgorithm)
vtkImageMapToColors16::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageMapToColors16::SetOutputFormatToRGBA
void SetOutputFormatToRGBA()
Definition vtkImageMapToColors16.h:66
vtkImageMapToColors16::SetOutputFormatToLuminanceAlpha
void SetOutputFormatToLuminanceAlpha()
Definition vtkImageMapToColors16.h:68
vtkImageMapToColors16::New
static vtkImageMapToColors16 * New()
vtkImageMapToColors16::vtkSetMacro
vtkSetMacro(OutputFormat, int)
vtkImageMapToColors16::vtkBooleanMacro
vtkBooleanMacro(PassAlphaToOutput, int)
vtkImageMapToColors16::OutputFormat
int OutputFormat
Definition vtkImageMapToColors16.h:108
vtkImageMapToColors16::PassAlphaToOutput
int PassAlphaToOutput
Definition vtkImageMapToColors16.h:111
vtkImageMapToColors16::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImageMapToColors16::vtkImageMapToColors16
vtkImageMapToColors16()
vtkImageMapToColors16::vtkSetMacro
vtkSetMacro(PassAlphaToOutput, int)
vtkImageMapToColors16::DataWasPassed
int DataWasPassed
Definition vtkImageMapToColors16.h:113
vtkImageMapToColors16::ActiveComponent
int ActiveComponent
Definition vtkImageMapToColors16.h:110