VTK  9.1.0
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=========================================================================*/
70#ifndef vtkImageResize_h
71#define vtkImageResize_h
72
73#include "vtkImagingCoreModule.h" // For export macro
75
77
78class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
79{
80public:
83 void PrintSelf(ostream& os, vtkIndent indent) override;
84
85 enum
86 {
89 MAGNIFICATION_FACTORS
90 };
91
93
99 vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
100 vtkGetMacro(ResizeMethod, int);
101 void SetResizeMethodToOutputDimensions() { this->SetResizeMethod(OUTPUT_DIMENSIONS); }
102 void SetResizeMethodToOutputSpacing() { this->SetResizeMethod(OUTPUT_SPACING); }
103 void SetResizeMethodToMagnificationFactors() { this->SetResizeMethod(MAGNIFICATION_FACTORS); }
104 virtual const char* GetResizeMethodAsString();
106
108
113 vtkSetVector3Macro(OutputDimensions, int);
114 vtkGetVector3Macro(OutputDimensions, int);
116
118
123 vtkSetVector3Macro(OutputSpacing, double);
124 vtkGetVector3Macro(OutputSpacing, double);
126
128
133 vtkSetVector3Macro(MagnificationFactors, double);
134 vtkGetVector3Macro(MagnificationFactors, double);
136
138
147 vtkSetMacro(Border, vtkTypeBool);
148 vtkBooleanMacro(Border, vtkTypeBool);
149 vtkGetMacro(Border, vtkTypeBool);
151
153
157 vtkSetMacro(Cropping, vtkTypeBool);
158 vtkBooleanMacro(Cropping, vtkTypeBool);
159 vtkGetMacro(Cropping, vtkTypeBool);
161
163
168 vtkSetVector6Macro(CroppingRegion, double);
169 vtkGetVector6Macro(CroppingRegion, double);
171
173
176 vtkSetMacro(Interpolate, vtkTypeBool);
177 vtkBooleanMacro(Interpolate, vtkTypeBool);
178 vtkGetMacro(Interpolate, vtkTypeBool);
180
182
188
193
194protected:
196 ~vtkImageResize() override;
197
199
204 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
205 int id) override;
206
208 int OutputDimensions[3];
209 double OutputSpacing[3];
210 double MagnificationFactors[3];
213 double CroppingRegion[6];
214
215 double IndexStretch[3];
216 double IndexTranslate[3];
217
221
222private:
223 vtkImageResize(const vtkImageResize&) = delete;
224 void operator=(const vtkImageResize&) = delete;
225};
226
227#endif
interpolate data values from images
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
High-quality image resizing filter.
vtkTypeBool Border
virtual vtkAbstractImageInterpolator * GetInterpolator()
Set the interpolator for resampling the data.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkTypeBool Interpolate
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...
vtkAbstractImageInterpolator * Interpolator
void SetResizeMethodToOutputDimensions()
The resizing method to use.
void SetResizeMethodToMagnificationFactors()
The resizing method to use.
~vtkImageResize() override
virtual const char * GetResizeMethodAsString()
The resizing method to use.
static vtkImageResize * New()
virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler)
Set the interpolator for resampling the data.
virtual vtkAbstractImageInterpolator * GetInternalInterpolator()
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:113
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