GDCM 2.2.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

vtkImageMapToColors16.h
Go to the documentation of this file.

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