VTK
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 =========================================================================*/
37 #ifndef vtkImageResize_h
38 #define vtkImageResize_h
39 
40 #include "vtkImagingCoreModule.h" // For export macro
42 
44 
45 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
46 {
47 public:
48  static vtkImageResize *New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
52  enum
53  {
56  MAGNIFICATION_FACTORS
57  };
58 
60 
66  vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
67  vtkGetMacro(ResizeMethod, int);
69  this->SetResizeMethod(OUTPUT_DIMENSIONS); }
71  this->SetResizeMethod(OUTPUT_SPACING); }
73  this->SetResizeMethod(MAGNIFICATION_FACTORS); }
74  virtual const char *GetResizeMethodAsString();
76 
78 
83  vtkSetVector3Macro(OutputDimensions, int);
84  vtkGetVector3Macro(OutputDimensions, int);
86 
88 
93  vtkSetVector3Macro(OutputSpacing, double);
94  vtkGetVector3Macro(OutputSpacing, double);
96 
98 
103  vtkSetVector3Macro(MagnificationFactors, double);
104  vtkGetVector3Macro(MagnificationFactors, double);
106 
108 
117  vtkSetMacro(Border, vtkTypeBool);
118  vtkBooleanMacro(Border, vtkTypeBool);
119  vtkGetMacro(Border, vtkTypeBool);
121 
123 
127  vtkSetMacro(Cropping, vtkTypeBool);
128  vtkBooleanMacro(Cropping, vtkTypeBool);
129  vtkGetMacro(Cropping, vtkTypeBool);
131 
133 
138  vtkSetVector6Macro(CroppingRegion, double);
139  vtkGetVector6Macro(CroppingRegion, double);
141 
143 
146  vtkSetMacro(Interpolate, vtkTypeBool);
147  vtkBooleanMacro(Interpolate, vtkTypeBool);
148  vtkGetMacro(Interpolate, vtkTypeBool);
150 
152 
155  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
156  virtual vtkAbstractImageInterpolator *GetInterpolator();
158 
162  vtkMTimeType GetMTime() override;
163 
164 protected:
165  vtkImageResize();
166  ~vtkImageResize() override;
167 
168  virtual vtkAbstractImageInterpolator *GetInternalInterpolator();
169 
171  vtkInformationVector *) override;
173  vtkInformationVector *) override;
175  vtkInformationVector *) override;
176  void ThreadedRequestData(vtkInformation *request,
177  vtkInformationVector **inputVector,
178  vtkInformationVector *outputVector,
179  vtkImageData ***inData,
180  vtkImageData **outData, int ext[6], int id) override;
181 
183  int OutputDimensions[3];
184  double OutputSpacing[3];
185  double MagnificationFactors[3];
188  double CroppingRegion[6];
189 
190  double IndexStretch[3];
191  double IndexTranslate[3];
192 
196 
197 private:
198  vtkImageResize(const vtkImageResize&) = delete;
199  void operator=(const vtkImageResize&) = delete;
200 };
201 
202 #endif
vtkThreadedImageAlgorithm::ThreadedRequestData
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up,...
vtkImageResize::OUTPUT_DIMENSIONS
Definition: vtkImageResize.h:54
vtkImageResize::Interpolate
vtkTypeBool Interpolate
Definition: vtkImageResize.h:195
vtkImageResize::OUTPUT_SPACING
Definition: vtkImageResize.h:55
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageResize::ResizeMethod
int ResizeMethod
Definition: vtkImageResize.h:182
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:43
vtkImageResize::Border
vtkTypeBool Border
Definition: vtkImageResize.h:186
vtkThreadedImageAlgorithm.h
vtkImageResize::NNInterpolator
vtkAbstractImageInterpolator * NNInterpolator
Definition: vtkImageResize.h:194
vtkImageAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageResize
High-quality image resizing filter.
Definition: vtkImageResize.h:45
vtkImageAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkThreadedImageAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:47
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImageResize::SetResizeMethodToOutputDimensions
void SetResizeMethodToOutputDimensions()
Definition: vtkImageResize.h:68
vtkImageResize::Cropping
vtkTypeBool Cropping
Definition: vtkImageResize.h:187
vtkImageResize::Interpolator
vtkAbstractImageInterpolator * Interpolator
Definition: vtkImageResize.h:193
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:70
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkImageResize::SetResizeMethodToMagnificationFactors
void SetResizeMethodToMagnificationFactors()
Definition: vtkImageResize.h:72
vtkImageResize::SetResizeMethodToOutputSpacing
void SetResizeMethodToOutputSpacing()
Definition: vtkImageResize.h:70
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:49
vtkThreadedImageAlgorithm::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304