VTK  9.3.1
vtkImageResize.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
25 #ifndef vtkImageResize_h
26 #define vtkImageResize_h
27 
28 #include "vtkImagingCoreModule.h" // For export macro
30 
31 VTK_ABI_NAMESPACE_BEGIN
33 
34 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
35 {
36 public:
37  static vtkImageResize* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
41  enum
42  {
45  MAGNIFICATION_FACTORS
46  };
47 
49 
55  vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
56  vtkGetMacro(ResizeMethod, int);
57  void SetResizeMethodToOutputDimensions() { this->SetResizeMethod(OUTPUT_DIMENSIONS); }
58  void SetResizeMethodToOutputSpacing() { this->SetResizeMethod(OUTPUT_SPACING); }
59  void SetResizeMethodToMagnificationFactors() { this->SetResizeMethod(MAGNIFICATION_FACTORS); }
60  virtual const char* GetResizeMethodAsString();
62 
64 
69  vtkSetVector3Macro(OutputDimensions, int);
70  vtkGetVector3Macro(OutputDimensions, int);
72 
74 
79  vtkSetVector3Macro(OutputSpacing, double);
80  vtkGetVector3Macro(OutputSpacing, double);
82 
84 
89  vtkSetVector3Macro(MagnificationFactors, double);
90  vtkGetVector3Macro(MagnificationFactors, double);
92 
94 
103  vtkSetMacro(Border, vtkTypeBool);
104  vtkBooleanMacro(Border, vtkTypeBool);
105  vtkGetMacro(Border, vtkTypeBool);
107 
109 
113  vtkSetMacro(Cropping, vtkTypeBool);
114  vtkBooleanMacro(Cropping, vtkTypeBool);
115  vtkGetMacro(Cropping, vtkTypeBool);
117 
119 
124  vtkSetVector6Macro(CroppingRegion, double);
125  vtkGetVector6Macro(CroppingRegion, double);
127 
129 
132  vtkSetMacro(Interpolate, vtkTypeBool);
133  vtkBooleanMacro(Interpolate, vtkTypeBool);
134  vtkGetMacro(Interpolate, vtkTypeBool);
136 
138 
141  virtual void SetInterpolator(vtkAbstractImageInterpolator* sampler);
142  virtual vtkAbstractImageInterpolator* GetInterpolator();
144 
148  vtkMTimeType GetMTime() override;
149 
150 protected:
151  vtkImageResize();
152  ~vtkImageResize() override;
153 
154  virtual vtkAbstractImageInterpolator* GetInternalInterpolator();
155 
159  void ThreadedRequestData(vtkInformation* request, vtkInformationVector** inputVector,
160  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
161  int id) override;
162 
164  int OutputDimensions[3];
165  double OutputSpacing[3];
166  double MagnificationFactors[3];
169  double CroppingRegion[6];
170 
171  double IndexStretch[3];
172  double IndexTranslate[3];
173 
177 
178 private:
179  vtkImageResize(const vtkImageResize&) = delete;
180  void operator=(const vtkImageResize&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #endif
interpolate data values from images
void SetResizeMethodToMagnificationFactors()
The resizing method to use.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkTypeBool Interpolate
vtkTypeBool Border
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
int vtkTypeBool
Definition: vtkABI.h:64
vtkAbstractImageInterpolator * NNInterpolator
Generic filter that has one input.
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...
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkAbstractImageInterpolator * Interpolator
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.
void SetResizeMethodToOutputSpacing()
The resizing method to use.
void SetResizeMethodToOutputDimensions()
The resizing method to use.
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.
vtkTypeBool Cropping
High-quality image resizing filter.