VTK  9.3.1
vtkImageShiftScale.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkImageShiftScale_h
20 #define vtkImageShiftScale_h
21 
22 #include "vtkImagingCoreModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKIMAGINGCORE_EXPORT vtkImageShiftScale : public vtkThreadedImageAlgorithm
27 {
28 public:
29  static vtkImageShiftScale* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
37  vtkSetMacro(Shift, double);
38  vtkGetMacro(Shift, double);
40 
42 
45  vtkSetMacro(Scale, double);
46  vtkGetMacro(Scale, double);
48 
50 
54  vtkSetMacro(OutputScalarType, int);
55  vtkGetMacro(OutputScalarType, int);
56  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
57  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
58  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
59  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
60  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
61  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
62  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
63  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
64  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
65  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
67 
69 
77  vtkSetMacro(ClampOverflow, vtkTypeBool);
78  vtkGetMacro(ClampOverflow, vtkTypeBool);
79  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
81 
82 protected:
84  ~vtkImageShiftScale() override;
85 
86  double Shift;
87  double Scale;
90 
92 
94  vtkImageData*** inData, vtkImageData** outData, int outExt[6], int threadId) override;
95 
96 private:
97  vtkImageShiftScale(const vtkImageShiftScale&) = delete;
98  void operator=(const vtkImageShiftScale&) = delete;
99 };
100 
101 VTK_ABI_NAMESPACE_END
102 #endif
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DOUBLE
Definition: vtkType.h:43
Generic filter that has one input.
shift and scale an input image
#define VTK_FLOAT
Definition: vtkType.h:42
void SetOutputScalarTypeToDouble()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
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:36
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
#define VTK_CHAR
Definition: vtkType.h:33
#define VTK_LONG
Definition: vtkType.h:40
void SetOutputScalarTypeToFloat()
Set the desired output scalar type.
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method.
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
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:41
void SetOutputScalarTypeToShort()
Set the desired output scalar type.
void SetOutputScalarTypeToLong()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type.
#define VTK_INT
Definition: vtkType.h:38