VTK  9.2.6
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 =========================================================================*/
46 #ifndef vtkImageResize_h
47 #define vtkImageResize_h
48 
49 #include "vtkImagingCoreModule.h" // For export macro
51 
53 
54 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
55 {
56 public:
57  static vtkImageResize* New();
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
61  enum
62  {
65  MAGNIFICATION_FACTORS
66  };
67 
69 
75  vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
76  vtkGetMacro(ResizeMethod, int);
77  void SetResizeMethodToOutputDimensions() { this->SetResizeMethod(OUTPUT_DIMENSIONS); }
78  void SetResizeMethodToOutputSpacing() { this->SetResizeMethod(OUTPUT_SPACING); }
79  void SetResizeMethodToMagnificationFactors() { this->SetResizeMethod(MAGNIFICATION_FACTORS); }
80  virtual const char* GetResizeMethodAsString();
82 
84 
89  vtkSetVector3Macro(OutputDimensions, int);
90  vtkGetVector3Macro(OutputDimensions, int);
92 
94 
99  vtkSetVector3Macro(OutputSpacing, double);
100  vtkGetVector3Macro(OutputSpacing, double);
102 
104 
109  vtkSetVector3Macro(MagnificationFactors, double);
110  vtkGetVector3Macro(MagnificationFactors, double);
112 
114 
123  vtkSetMacro(Border, vtkTypeBool);
124  vtkBooleanMacro(Border, vtkTypeBool);
125  vtkGetMacro(Border, vtkTypeBool);
127 
129 
133  vtkSetMacro(Cropping, vtkTypeBool);
134  vtkBooleanMacro(Cropping, vtkTypeBool);
135  vtkGetMacro(Cropping, vtkTypeBool);
137 
139 
144  vtkSetVector6Macro(CroppingRegion, double);
145  vtkGetVector6Macro(CroppingRegion, double);
147 
149 
152  vtkSetMacro(Interpolate, vtkTypeBool);
153  vtkBooleanMacro(Interpolate, vtkTypeBool);
154  vtkGetMacro(Interpolate, vtkTypeBool);
156 
158 
164 
168  vtkMTimeType GetMTime() override;
169 
170 protected:
172  ~vtkImageResize() override;
173 
175 
180  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
181  int id) override;
182 
184  int OutputDimensions[3];
185  double OutputSpacing[3];
186  double MagnificationFactors[3];
189  double CroppingRegion[6];
190 
191  double IndexStretch[3];
192  double IndexTranslate[3];
193 
197 
198 private:
199  vtkImageResize(const vtkImageResize&) = delete;
200  void operator=(const vtkImageResize&) = delete;
201 };
202 
203 #endif
interpolate data values from images
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
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:49
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