VTK  9.0.1
vtkImageShiftScale.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageShiftScale.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 =========================================================================*/
25 #ifndef vtkImageShiftScale_h
26 #define vtkImageShiftScale_h
27 
28 #include "vtkImagingCoreModule.h" // For export macro
30 
31 class VTKIMAGINGCORE_EXPORT vtkImageShiftScale : public vtkThreadedImageAlgorithm
32 {
33 public:
34  static vtkImageShiftScale* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
42  vtkSetMacro(Shift, double);
43  vtkGetMacro(Shift, double);
45 
47 
50  vtkSetMacro(Scale, double);
51  vtkGetMacro(Scale, double);
53 
55 
59  vtkSetMacro(OutputScalarType, int);
60  vtkGetMacro(OutputScalarType, int);
61  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
62  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
63  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
64  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
65  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
66  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
67  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
68  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
69  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
70  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
72 
74 
82  vtkSetMacro(ClampOverflow, vtkTypeBool);
83  vtkGetMacro(ClampOverflow, vtkTypeBool);
84  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
86 
87 protected:
89  ~vtkImageShiftScale() override;
90 
91  double Shift;
92  double Scale;
95 
97 
99  vtkImageData*** inData, vtkImageData** outData, int outExt[6], int threadId) override;
100 
101 private:
102  vtkImageShiftScale(const vtkImageShiftScale&) = delete;
103  void operator=(const vtkImageShiftScale&) = delete;
104 };
105 
106 #endif
#define VTK_UNSIGNED_INT
Definition: vtkType.h:49
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:47
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE
Definition: vtkType.h:53
Generic filter that has one input.
shift and scale an input image
#define VTK_FLOAT
Definition: vtkType.h:52
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:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
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:46
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
#define VTK_CHAR
Definition: vtkType.h:43
#define VTK_LONG
Definition: vtkType.h:50
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:45
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:51
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:48