VTK  9.2.6
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 #include "vtkImagingCoreModule.h" // For export macro
44 
45 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
46 {
47 public:
48  static vtkImageCast* New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
56  vtkSetMacro(OutputScalarType, int);
57  vtkGetMacro(OutputScalarType, int);
58  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
59  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
60  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
61  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
62  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
63  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
64  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
65  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
66  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
67  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
69 
71 
79  vtkSetMacro(ClampOverflow, vtkTypeBool);
80  vtkGetMacro(ClampOverflow, vtkTypeBool);
81  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
83 
84 protected:
85  vtkImageCast();
86  ~vtkImageCast() override = default;
87 
91 
92  void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
93 
94 private:
95  vtkImageCast(const vtkImageCast&) = delete;
96  void operator=(const vtkImageCast&) = delete;
97 };
98 
99 #endif
Image Data type Casting Filter.
Definition: vtkImageCast.h:45
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
int OutputScalarType
Definition: vtkImageCast.h:89
virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int threadId)
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:60
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:66
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:88
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE
Definition: vtkType.h:55
Generic filter that has one input.
#define VTK_FLOAT
Definition: vtkType.h:54
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
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:48
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_LONG
Definition: vtkType.h:52
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:63
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:59
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:64
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:61
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:65
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:53
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:62
#define VTK_INT
Definition: vtkType.h:50
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:58
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:67