# vtkImageMapToColors16.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkImageMapToColors16.h,v $
    00005
    00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
    00007   All rights reserved.
    00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 // .NAME vtkImageMapToColors16 - map the input image through a lookup table
    00016 // .SECTION Description
    00017 // The vtkImageMapToColors16 filter will take an input image of any valid
    00018 // scalar type, and map the first component of the image through a
    00019 // lookup table.  The result is an image of type VTK_UNSIGNED_CHAR.
    00020 // If the lookup table is not set, or is set to NULL, then the input
    00021 // data will be passed through if it is already of type VTK_UNSIGNED_CHAR.
    00022
    00023 // .SECTION See Also
    00024 // vtkLookupTable vtkScalarsToColors
    00025
    00026 #ifndef VTKIMAGEMAPTOCOLORS16_H
    00027 #define VTKIMAGEMAPTOCOLORS16_H
    00028
    00029
    00030 #include "vtkThreadedImageAlgorithm.h"
    00031
    00032 class vtkScalarsToColors;
    00033
    00034 class VTK_EXPORT vtkImageMapToColors16 : public vtkThreadedImageAlgorithm
    00035 {
    00036 public:
    00037   static vtkImageMapToColors16 *New();
    00038   vtkTypeRevisionMacro(vtkImageMapToColors16,vtkThreadedImageAlgorithm);
    00039   void PrintSelf(ostream& os, vtkIndent indent);
    00040
    00041   // Description:
    00042   // Set the lookup table.
    00043   virtual void SetLookupTable(vtkScalarsToColors*);
    00044   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
    00045
    00046   // Description:
    00047   // Set the output format, the default is RGBA.
    00048   vtkSetMacro(OutputFormat,int);
    00049   vtkGetMacro(OutputFormat,int);
    00050   void SetOutputFormatToRGBA() { this->OutputFormat = VTK_RGBA; };
    00051   void SetOutputFormatToRGB() { this->OutputFormat = VTK_RGB; };
    00052   void SetOutputFormatToLuminanceAlpha() { this->OutputFormat = VTK_LUMINANCE_ALPHA; };
    00053   void SetOutputFormatToLuminance() { this->OutputFormat = VTK_LUMINANCE; };
    00054
    00055   // Description:
    00056   // Set the component to map for multi-component images (default: 0)
    00057   vtkSetMacro(ActiveComponent,int);
    00058   vtkGetMacro(ActiveComponent,int);
    00059
    00060   // Description:
    00061   // Use the alpha component of the input when computing the alpha component
    00062   // of the output (useful when converting monochrome+alpha data to RGBA)
    00063   vtkSetMacro(PassAlphaToOutput,int);
    00064   vtkBooleanMacro(PassAlphaToOutput,int);
    00065   vtkGetMacro(PassAlphaToOutput,int);
    00066
    00067   // Description:
    00068   // We need to check the modified time of the lookup table too.
    00069   virtual unsigned long GetMTime();
    00070
    00071 protected:
    00072   vtkImageMapToColors16();
    00073   ~vtkImageMapToColors16();
    00074
    00075   virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
    00076
    00077   void ThreadedRequestData(vtkInformation *request,
    00078                            vtkInformationVector **inputVector,
    00079                            vtkInformationVector *outputVector,
    00080                            vtkImageData ***inData, vtkImageData **outData,
    00081                            int extent[6], int id);
    00082
    00083   virtual int RequestData(vtkInformation *request,
    00084                           vtkInformationVector **inputVector,
    00085                           vtkInformationVector *outputVector);
    00086
    00087   vtkScalarsToColors *LookupTable;
    00088   int OutputFormat;
    00089
    00090   int ActiveComponent;
    00091   int PassAlphaToOutput;
    00092
    00093   int DataWasPassed;
    00094 private:
    00095   vtkImageMapToColors16(const vtkImageMapToColors16&);  // Not implemented.
    00096   void operator=(const vtkImageMapToColors16&);  // Not implemented.
    00097 };
    00098
    00099 #endif
    00100
    00101
    00102
    00103
    00104
    00105
    00106