VTK  9.0.3
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 =========================================================================*/
31 #ifndef vtkImageResize_h
32 #define vtkImageResize_h
33 
34 #include "vtkImagingCoreModule.h" // For export macro
36 
38 
39 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
40 {
41 public:
42  static vtkImageResize* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46  enum
47  {
50  MAGNIFICATION_FACTORS
51  };
52 
54 
60  vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
61  vtkGetMacro(ResizeMethod, int);
62  void SetResizeMethodToOutputDimensions() { this->SetResizeMethod(OUTPUT_DIMENSIONS); }
63  void SetResizeMethodToOutputSpacing() { this->SetResizeMethod(OUTPUT_SPACING); }
64  void SetResizeMethodToMagnificationFactors() { this->SetResizeMethod(MAGNIFICATION_FACTORS); }
65  virtual const char* GetResizeMethodAsString();
67 
69 
74  vtkSetVector3Macro(OutputDimensions, int);
75  vtkGetVector3Macro(OutputDimensions, int);
77 
79 
84  vtkSetVector3Macro(OutputSpacing, double);
85  vtkGetVector3Macro(OutputSpacing, double);
87 
89 
94  vtkSetVector3Macro(MagnificationFactors, double);
95  vtkGetVector3Macro(MagnificationFactors, double);
97 
99 
108  vtkSetMacro(Border, vtkTypeBool);
109  vtkBooleanMacro(Border, vtkTypeBool);
110  vtkGetMacro(Border, vtkTypeBool);
112 
114 
118  vtkSetMacro(Cropping, vtkTypeBool);
119  vtkBooleanMacro(Cropping, vtkTypeBool);
120  vtkGetMacro(Cropping, vtkTypeBool);
122 
124 
129  vtkSetVector6Macro(CroppingRegion, double);
130  vtkGetVector6Macro(CroppingRegion, double);
132 
134 
137  vtkSetMacro(Interpolate, vtkTypeBool);
138  vtkBooleanMacro(Interpolate, vtkTypeBool);
139  vtkGetMacro(Interpolate, vtkTypeBool);
141 
143 
149 
153  vtkMTimeType GetMTime() override;
154 
155 protected:
157  ~vtkImageResize() override;
158 
160 
165  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
166  int id) override;
167 
169  int OutputDimensions[3];
170  double OutputSpacing[3];
171  double MagnificationFactors[3];
174  double CroppingRegion[6];
175 
176  double IndexStretch[3];
177  double IndexTranslate[3];
178 
182 
183 private:
184  vtkImageResize(const vtkImageResize&) = delete;
185  void operator=(const vtkImageResize&) = delete;
186 };
187 
188 #endif
interpolate data values from images
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
High-quality image resizing filter.
virtual const char * GetResizeMethodAsString()
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()
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()
void SetResizeMethodToMagnificationFactors()
~vtkImageResize() override
static vtkImageResize * New()
virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler)
Set the interpolator for resampling the data.
void SetResizeMethodToOutputSpacing()
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:34
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:293