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 =========================================================================*/
39 #ifndef vtkImageCast_h
40 #define vtkImageCast_h
41 
42 
43 #include "vtkImagingCoreModule.h" // For export macro
45 
46 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
47 {
48 public:
49  static vtkImageCast *New();
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
57  vtkSetMacro(OutputScalarType,int);
58  vtkGetMacro(OutputScalarType,int);
59  void SetOutputScalarTypeToFloat(){this->SetOutputScalarType(VTK_FLOAT);};
60  void SetOutputScalarTypeToDouble(){this->SetOutputScalarType(VTK_DOUBLE);};
61  void SetOutputScalarTypeToInt(){this->SetOutputScalarType(VTK_INT);};
63  {this->SetOutputScalarType(VTK_UNSIGNED_INT);};
64  void SetOutputScalarTypeToLong(){this->SetOutputScalarType(VTK_LONG);};
66  {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
67  void SetOutputScalarTypeToShort(){this->SetOutputScalarType(VTK_SHORT);};
69  {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);};
71  {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);};
73  {this->SetOutputScalarType(VTK_CHAR);};
75 
77 
85  vtkSetMacro(ClampOverflow, vtkTypeBool);
86  vtkGetMacro(ClampOverflow, vtkTypeBool);
87  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
89 
90 
91 protected:
92  vtkImageCast();
93  ~vtkImageCast() override {}
94 
98 
99  void ThreadedExecute (vtkImageData *inData, vtkImageData *outData,
100  int ext[6], int id) override;
101 
102 private:
103  vtkImageCast(const vtkImageCast&) = delete;
104  void operator=(const vtkImageCast&) = delete;
105 };
106 
107 #endif
108 
109 
110 
111 
vtkImageCast::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Definition: vtkImageCast.h:68
vtkImageCast::ClampOverflow
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:95
vtkImageCast::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Definition: vtkImageCast.h:65
vtkImageCast::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Definition: vtkImageCast.h:67
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:55
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:53
vtkImageCast::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Definition: vtkImageCast.h:60
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:43
vtkThreadedImageAlgorithm.h
vtkImageCast::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Definition: vtkImageCast.h:64
vtkImageCast::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Definition: vtkImageCast.h:61
vtkImageCast::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Definition: vtkImageCast.h:70
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:49
vtkImageCast::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Definition: vtkImageCast.h:72
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:47
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:58
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:59
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:51
VTK_LONG
#define VTK_LONG
Definition: vtkType.h:56
vtkImageCast::~vtkImageCast
~vtkImageCast() override
Definition: vtkImageCast.h:93
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:57
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:70
vtkAlgorithm::New
static vtkAlgorithm * New()
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:52
vtkImageCast::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Definition: vtkImageCast.h:59
vtkThreadedImageAlgorithm::ThreadedExecute
virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int threadId)
VTK_INT
#define VTK_INT
Definition: vtkType.h:54
vtkImageCast::OutputScalarType
int OutputScalarType
Definition: vtkImageCast.h:96
vtkImageCast
Image Data type Casting Filter.
Definition: vtkImageCast.h:46
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkImageCast::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Definition: vtkImageCast.h:62