VTK
dox/Imaging/vtkImageCast.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageCast.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 =========================================================================*/
00038 #ifndef __vtkImageCast_h
00039 #define __vtkImageCast_h
00040 
00041 
00042 #include "vtkThreadedImageAlgorithm.h"
00043 
00044 class VTK_IMAGING_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
00045 {
00046 public:
00047   static vtkImageCast *New();
00048   vtkTypeMacro(vtkImageCast,vtkThreadedImageAlgorithm);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00053   vtkSetMacro(OutputScalarType,int);
00054   vtkGetMacro(OutputScalarType,int);
00055   void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);};
00056   void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);};
00057   void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);};
00058   void SetOutputScalarTypeToUnsignedInt()
00059     {this->SetOutputScalarType(VTK_UNSIGNED_INT);};
00060   void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);};
00061   void SetOutputScalarTypeToUnsignedLong()
00062     {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
00063   void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);};
00064   void SetOutputScalarTypeToUnsignedShort()
00065     {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);};
00066   void SetOutputScalarTypeToUnsignedChar()
00067     {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);};
00068   void SetOutputScalarTypeToChar()
00069     {this->SetOutputScalarType(VTK_CHAR);};
00071 
00073 
00076   vtkSetMacro(ClampOverflow, int);
00077   vtkGetMacro(ClampOverflow, int);
00078   vtkBooleanMacro(ClampOverflow, int);
00080   
00081   
00082 protected:
00083   vtkImageCast();
00084   ~vtkImageCast() {};
00085 
00086   int ClampOverflow;
00087   int OutputScalarType;
00088   virtual int RequestInformation (vtkInformation *, vtkInformationVector**, vtkInformationVector *);
00089   
00090   void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, 
00091                        int ext[6], int id);
00092 
00093 private:
00094   vtkImageCast(const vtkImageCast&);  // Not implemented.
00095   void operator=(const vtkImageCast&);  // Not implemented.
00096 };
00097 
00098 #endif
00099 
00100 
00101 
00102