VTK  9.2.5
vtkImageResize.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageResize.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 =========================================================================*/
76 #ifndef vtkImageResize_h
77 #define vtkImageResize_h
78 
79 #include "vtkImagingCoreModule.h" // For export macro
81 
83 
84 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
85 {
86 public:
87  static vtkImageResize* New();
89  void PrintSelf(ostream& os, vtkIndent indent) override;
90 
91  enum
92  {
95  MAGNIFICATION_FACTORS
96  };
97 
99 
105  vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
106  vtkGetMacro(ResizeMethod, int);
107  void SetResizeMethodToOutputDimensions() { this->SetResizeMethod(OUTPUT_DIMENSIONS); }
108  void SetResizeMethodToOutputSpacing() { this->SetResizeMethod(OUTPUT_SPACING); }
109  void SetResizeMethodToMagnificationFactors() { this->SetResizeMethod(MAGNIFICATION_FACTORS); }
110  virtual const char* GetResizeMethodAsString();
112 
114 
119  vtkSetVector3Macro(OutputDimensions, int);
120  vtkGetVector3Macro(OutputDimensions, int);
122 
124 
129  vtkSetVector3Macro(OutputSpacing, double);
130  vtkGetVector3Macro(OutputSpacing, double);
132 
134 
139  vtkSetVector3Macro(MagnificationFactors, double);
140  vtkGetVector3Macro(MagnificationFactors, double);
142 
144 
153  vtkSetMacro(Border, vtkTypeBool);
154  vtkBooleanMacro(Border, vtkTypeBool);
155  vtkGetMacro(Border, vtkTypeBool);
157 
159 
163  vtkSetMacro(Cropping, vtkTypeBool);
164  vtkBooleanMacro(Cropping, vtkTypeBool);
165  vtkGetMacro(Cropping, vtkTypeBool);
167 
169 
174  vtkSetVector6Macro(CroppingRegion, double);
175  vtkGetVector6Macro(CroppingRegion, double);
177 
179 
182  vtkSetMacro(Interpolate, vtkTypeBool);
183  vtkBooleanMacro(Interpolate, vtkTypeBool);
184  vtkGetMacro(Interpolate, vtkTypeBool);
186 
188 
194 
198  vtkMTimeType GetMTime() override;
199 
200 protected:
202  ~vtkImageResize() override;
203 
205 
210  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
211  int id) override;
212 
214  int OutputDimensions[3];
215  double OutputSpacing[3];
216  double MagnificationFactors[3];
219  double CroppingRegion[6];
220 
221  double IndexStretch[3];
222  double IndexTranslate[3];
223 
227 
228 private:
229  vtkImageResize(const vtkImageResize&) = delete;
230  void operator=(const vtkImageResize&) = delete;
231 };
232 
233 #endif
interpolate data values from images
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
High-quality image resizing filter.
virtual const char * GetResizeMethodAsString()
The resizing method to use.
vtkTypeBool Border
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkTypeBool Interpolate
virtual vtkAbstractImageInterpolator * GetInterpolator()
Set the interpolator for resampling the data.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
vtkMTimeType GetMTime() override
Get the modified time of the filter.
vtkAbstractImageInterpolator * NNInterpolator
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual vtkAbstractImageInterpolator * GetInternalInterpolator()
vtkAbstractImageInterpolator * Interpolator
void SetResizeMethodToOutputDimensions()
The resizing method to use.
void SetResizeMethodToMagnificationFactors()
The resizing method to use.
~vtkImageResize() override
static vtkImageResize * New()
virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler)
Set the interpolator for resampling the data.
void SetResizeMethodToOutputSpacing()
The resizing method to use.
vtkTypeBool Cropping
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287