VTK
dox/Imaging/vtkImageResliceToColors.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageResliceToColors.h
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 =========================================================================*/
00033 #ifndef __vtkImageResliceToColors_h
00034 #define __vtkImageResliceToColors_h
00035 
00036 
00037 #include "vtkImageReslice.h"
00038 
00039 class vtkScalarsToColors;
00040 
00041 class VTK_IMAGING_EXPORT vtkImageResliceToColors : public vtkImageReslice
00042 {
00043 public:
00044   static vtkImageResliceToColors *New();
00045   vtkTypeMacro(vtkImageResliceToColors, vtkImageReslice);
00046 
00047   virtual void PrintSelf(ostream& os, vtkIndent indent);
00048 
00050 
00055   virtual void SetLookupTable(vtkScalarsToColors *table);
00056   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
00058 
00060 
00061   vtkSetClampMacro(OutputFormat,int,VTK_LUMINANCE,VTK_RGBA);
00062   vtkGetMacro(OutputFormat,int);
00063   void SetOutputFormatToRGBA() {
00064     this->OutputFormat = VTK_RGBA; };
00065   void SetOutputFormatToRGB() {
00066     this->OutputFormat = VTK_RGB; };
00067   void SetOutputFormatToLuminanceAlpha() {
00068     this->OutputFormat = VTK_LUMINANCE_ALPHA; };
00069   void SetOutputFormatToLuminance() {
00070     this->OutputFormat = VTK_LUMINANCE; };
00072 
00074 
00077   void SetBypass(int bypass);
00078   void BypassOn() { this->SetBypass(1); }
00079   void BypassOff() { this->SetBypass(0); }
00080   int GetBypass() { return this->Bypass; }
00082 
00085   unsigned long int GetMTime();
00086 
00087 protected:
00088   vtkImageResliceToColors();
00089   ~vtkImageResliceToColors();
00090 
00091   vtkScalarsToColors *LookupTable;
00092   vtkScalarsToColors *DefaultLookupTable;
00093   int OutputFormat;
00094   int Bypass;
00095 
00096   int ConvertScalarInfo(int &scalarType, int &numComponents);
00097 
00098   void ConvertScalars(void *inPtr, void *outPtr, int inputType,
00099                       int inputNumComponents, int count,
00100                       int idX, int idY, int idZ, int threadId);
00101 
00102 private:
00103   vtkImageResliceToColors(const vtkImageResliceToColors&);  // Not implemented.
00104   void operator=(const vtkImageResliceToColors&);  // Not implemented.
00105 };
00106 
00107 #endif