VTK  9.1.0
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 =========================================================================*/
134 #ifndef vtkImageShiftScale_h
135 #define vtkImageShiftScale_h
136 
137 #include "vtkImagingCoreModule.h" // For export macro
139 
140 class VTKIMAGINGCORE_EXPORT vtkImageShiftScale : public vtkThreadedImageAlgorithm
141 {
142 public:
145  void PrintSelf(ostream& os, vtkIndent indent) override;
146 
148 
151  vtkSetMacro(Shift, double);
152  vtkGetMacro(Shift, double);
154 
156 
159  vtkSetMacro(Scale, double);
160  vtkGetMacro(Scale, double);
162 
164 
168  vtkSetMacro(OutputScalarType, int);
169  vtkGetMacro(OutputScalarType, int);
170  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
171  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
172  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
173  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
174  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
175  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
176  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
177  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
178  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
179  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
181 
183 
191  vtkSetMacro(ClampOverflow, vtkTypeBool);
192  vtkGetMacro(ClampOverflow, vtkTypeBool);
193  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
195 
196 protected:
199 
200  double Shift;
201  double Scale;
204 
206 
208  vtkImageData*** inData, vtkImageData** outData, int outExt[6], int threadId) override;
209 
210 private:
211  vtkImageShiftScale(const vtkImageShiftScale&) = delete;
212  void operator=(const vtkImageShiftScale&) = delete;
213 };
214 
215 #endif
vtkImageShiftScale::SetOutputScalarTypeToInt
void SetOutputScalarTypeToInt()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:174
vtkImageShiftScale::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageShiftScale::SetOutputScalarTypeToFloat
void SetOutputScalarTypeToFloat()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:171
VTK_UNSIGNED_INT
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
vtkImageShiftScale::SetOutputScalarTypeToUnsignedShort
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:177
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:39
vtkImageShiftScale::ThreadedRequestData
void ThreadedRequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int threadId) override
If the subclass does not define an Execute method, then the task will be broken up,...
vtkImageShiftScale::~vtkImageShiftScale
~vtkImageShiftScale() override
vtkImageShiftScale::SetOutputScalarTypeToShort
void SetOutputScalarTypeToShort()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:176
vtkThreadedImageAlgorithm.h
vtkImageShiftScale::SetOutputScalarTypeToUnsignedLong
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:173
vtkImageShiftScale::SetOutputScalarTypeToChar
void SetOutputScalarTypeToChar()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:178
vtkImageShiftScale::Shift
double Shift
Definition: vtkImageShiftScale.h:200
VTK_CHAR
#define VTK_CHAR
Definition: vtkType.h:45
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkImageShiftScale
shift and scale an input image
Definition: vtkImageShiftScale.h:141
vtkImageShiftScale::vtkImageShiftScale
vtkImageShiftScale()
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
vtkImageShiftScale::SetOutputScalarTypeToUnsignedChar
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:179
VTK_UNSIGNED_LONG
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkImageShiftScale::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageShiftScale::OutputScalarType
int OutputScalarType
Definition: vtkImageShiftScale.h:202
vtkImageShiftScale::Scale
double Scale
Definition: vtkImageShiftScale.h:201
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:48
vtkImageShiftScale::SetOutputScalarTypeToLong
void SetOutputScalarTypeToLong()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:172
vtkImageShiftScale::New
static vtkImageShiftScale * New()
vtkImageShiftScale::SetOutputScalarTypeToUnsignedInt
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:175
vtkImageShiftScale::ClampOverflow
vtkTypeBool ClampOverflow
Definition: vtkImageShiftScale.h:203
VTK_INT
#define VTK_INT
Definition: vtkType.h:50
vtkImageShiftScale::SetOutputScalarTypeToDouble
void SetOutputScalarTypeToDouble()
Set the desired output scalar type.
Definition: vtkImageShiftScale.h:170
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69