VTK
vtkImageCast.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageCast.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkImageCast_h
34 #define vtkImageCast_h
35 
36 
37 #include "vtkImagingCoreModule.h" // For export macro
39 
40 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
41 {
42 public:
43  static vtkImageCast *New();
45  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
46 
48 
51  vtkSetMacro(OutputScalarType,int);
52  vtkGetMacro(OutputScalarType,int);
53  void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);};
54  void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);};
55  void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);};
57  {this->SetOutputScalarType(VTK_UNSIGNED_INT);};
58  void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);};
60  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
61  void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);};
63  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);};
65  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);};
67  {this->SetOutputScalarType(VTK_CHAR);};
69 
71 
79  vtkSetMacro(ClampOverflow, int);
80  vtkGetMacro(ClampOverflow, int);
81  vtkBooleanMacro(ClampOverflow, int);
83 
84 
85 protected:
86  vtkImageCast();
87  ~vtkImageCast()VTK_OVERRIDE {}
88 
92 
93  void ThreadedExecute (vtkImageData *inData, vtkImageData *outData,
94  int ext[6], int id) VTK_OVERRIDE;
95 
96 private:
97  vtkImageCast(const vtkImageCast&) VTK_DELETE_FUNCTION;
98  void operator=(const vtkImageCast&) VTK_DELETE_FUNCTION;
99 };
100 
101 #endif
102 
103 
104 
105 
Image Data type Casting Filter.
Definition: vtkImageCast.h:40
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
int OutputScalarType
Definition: vtkImageCast.h:90
virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int threadId)
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:55
~vtkImageCast() override
Definition: vtkImageCast.h:87
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:64
#define VTK_DOUBLE
Definition: vtkType.h:59
Generic filter that has one input.
#define VTK_FLOAT
Definition: vtkType.h:58
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
#define VTK_SHORT
Definition: vtkType.h:52
#define VTK_CHAR
Definition: vtkType.h:49
#define VTK_LONG
Definition: vtkType.h:56
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:59
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:54
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:61
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:56
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:62
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:58
#define VTK_INT
Definition: vtkType.h:54
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:53
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:66