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