# 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 #include "gdcmTypes.h" // GDCM_EXPORT
    00032
    00033 class vtkScalarsToColors;
    00034
    00035 class GDCM_EXPORT vtkImageMapToColors16 : public vtkThreadedImageAlgorithm
    00036 {
    00037 public:
    00038   static vtkImageMapToColors16 *New();
    00039   vtkTypeRevisionMacro(vtkImageMapToColors16,vtkThreadedImageAlgorithm);
    00040   void PrintSelf(ostream& os, vtkIndent indent);
    00041
    00042   // Description:
    00043   // Set the lookup table.
    00044   virtual void SetLookupTable(vtkScalarsToColors*);
    00045   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
    00046
    00047   // Description:
    00048   // Set the output format, the default is RGBA.
    00049   vtkSetMacro(OutputFormat,int);
    00050   vtkGetMacro(OutputFormat,int);
    00051   void SetOutputFormatToRGBA() { this->OutputFormat = VTK_RGBA; };
    00052   void SetOutputFormatToRGB() { this->OutputFormat = VTK_RGB; };
    00053   void SetOutputFormatToLuminanceAlpha() { this->OutputFormat = VTK_LUMINANCE_ALPHA; };
    00054   void SetOutputFormatToLuminance() { this->OutputFormat = VTK_LUMINANCE; };
    00055
    00056   // Description:
    00057   // Set the component to map for multi-component images (default: 0)
    00058   vtkSetMacro(ActiveComponent,int);
    00059   vtkGetMacro(ActiveComponent,int);
    00060
    00061   // Description:
    00062   // Use the alpha component of the input when computing the alpha component
    00063   // of the output (useful when converting monochrome+alpha data to RGBA)
    00064   vtkSetMacro(PassAlphaToOutput,int);
    00065   vtkBooleanMacro(PassAlphaToOutput,int);
    00066   vtkGetMacro(PassAlphaToOutput,int);
    00067
    00068   // Description:
    00069   // We need to check the modified time of the lookup table too.
    00070   virtual unsigned long GetMTime();
    00071
    00072 protected:
    00073   vtkImageMapToColors16();
    00074   ~vtkImageMapToColors16();
    00075
    00076   virtual int RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
    00077
    00078   void ThreadedRequestData(vtkInformation *request,
    00079                            vtkInformationVector **inputVector,
    00080                            vtkInformationVector *outputVector,
    00081                            vtkImageData ***inData, vtkImageData **outData,
    00082                            int extent[6], int id);
    00083
    00084   virtual int RequestData(vtkInformation *request,
    00085                           vtkInformationVector **inputVector,
    00086                           vtkInformationVector *outputVector);
    00087
    00088   vtkScalarsToColors *LookupTable;
    00089   int OutputFormat;
    00090
    00091   int ActiveComponent;
    00092   int PassAlphaToOutput;
    00093
    00094   int DataWasPassed;
    00095 private:
    00096   vtkImageMapToColors16(const vtkImageMapToColors16&);  // Not implemented.
    00097   void operator=(const vtkImageMapToColors16&);  // Not implemented.
    00098 };
    00099
    00100 #endif
    00101
    00102
    00103
    00104
    00105
    00106
    00107