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 
78 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
79 {
80 public:
81  static vtkImageResize* New();
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 
192  vtkMTimeType GetMTime() override;
193 
194 protected:
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 
222 private:
223  vtkImageResize(const vtkImageResize&) = delete;
224  void operator=(const vtkImageResize&) = delete;
225 };
226 
227 #endif
vtkImageResize::GetInternalInterpolator
virtual vtkAbstractImageInterpolator * GetInternalInterpolator()
vtkImageResize::GetResizeMethodAsString
virtual const char * GetResizeMethodAsString()
The resizing method to use.
vtkImageResize::GetMTime
vtkMTimeType GetMTime() override
Get the modified time of the filter.
vtkImageResize::Interpolate
vtkTypeBool Interpolate
Definition: vtkImageResize.h:220
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkImageResize::ResizeMethod
int ResizeMethod
Definition: vtkImageResize.h:207
vtkImageResize::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:39
vtkImageResize::Border
vtkTypeBool Border
Definition: vtkImageResize.h:211
vtkThreadedImageAlgorithm.h
vtkImageResize::OUTPUT_DIMENSIONS
@ OUTPUT_DIMENSIONS
Definition: vtkImageResize.h:87
vtkImageResize::NNInterpolator
vtkAbstractImageInterpolator * NNInterpolator
Definition: vtkImageResize.h:219
vtkImageResize
High-quality image resizing filter.
Definition: vtkImageResize.h:79
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkImageResize::SetResizeMethodToOutputDimensions
void SetResizeMethodToOutputDimensions()
The resizing method to use.
Definition: vtkImageResize.h:101
vtkImageResize::Cropping
vtkTypeBool Cropping
Definition: vtkImageResize.h:212
vtkImageResize::OUTPUT_SPACING
@ OUTPUT_SPACING
Definition: vtkImageResize.h:88
vtkImageResize::Interpolator
vtkAbstractImageInterpolator * Interpolator
Definition: vtkImageResize.h:218
vtkImageResize::GetInterpolator
virtual vtkAbstractImageInterpolator * GetInterpolator()
Set the interpolator for resampling the data.
vtkImageResize::vtkImageResize
vtkImageResize()
vtkImageResize::~vtkImageResize
~vtkImageResize() override
vtkImageResize::New
static vtkImageResize * New()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkImageResize::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageResize::SetResizeMethodToMagnificationFactors
void SetResizeMethodToMagnificationFactors()
The resizing method to use.
Definition: vtkImageResize.h:103
vtkImageResize::ThreadedRequestData
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,...
vtkImageResize::SetInterpolator
virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler)
Set the interpolator for resampling the data.
vtkImageResize::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkImageResize::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageResize::SetResizeMethodToOutputSpacing
void SetResizeMethodToOutputSpacing()
The resizing method to use.
Definition: vtkImageResize.h:102
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:47
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287