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 =========================================================================*/
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);
63  this->SetResizeMethod(OUTPUT_DIMENSIONS); }
65  this->SetResizeMethod(OUTPUT_SPACING); }
67  this->SetResizeMethod(MAGNIFICATION_FACTORS); }
68  virtual const char *GetResizeMethodAsString();
70 
72 
77  vtkSetVector3Macro(OutputDimensions, int);
78  vtkGetVector3Macro(OutputDimensions, int);
80 
82 
87  vtkSetVector3Macro(OutputSpacing, double);
88  vtkGetVector3Macro(OutputSpacing, double);
90 
92 
97  vtkSetVector3Macro(MagnificationFactors, double);
98  vtkGetVector3Macro(MagnificationFactors, double);
100 
102 
111  vtkSetMacro(Border, vtkTypeBool);
112  vtkBooleanMacro(Border, vtkTypeBool);
113  vtkGetMacro(Border, vtkTypeBool);
115 
117 
121  vtkSetMacro(Cropping, vtkTypeBool);
122  vtkBooleanMacro(Cropping, vtkTypeBool);
123  vtkGetMacro(Cropping, vtkTypeBool);
125 
127 
132  vtkSetVector6Macro(CroppingRegion, double);
133  vtkGetVector6Macro(CroppingRegion, double);
135 
137 
140  vtkSetMacro(Interpolate, vtkTypeBool);
141  vtkBooleanMacro(Interpolate, vtkTypeBool);
142  vtkGetMacro(Interpolate, vtkTypeBool);
144 
146 
149  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
150  virtual vtkAbstractImageInterpolator *GetInterpolator();
152 
156  vtkMTimeType GetMTime() override;
157 
158 protected:
159  vtkImageResize();
160  ~vtkImageResize() override;
161 
162  virtual vtkAbstractImageInterpolator *GetInternalInterpolator();
163 
165  vtkInformationVector *) override;
167  vtkInformationVector *) override;
169  vtkInformationVector *) override;
170  void ThreadedRequestData(vtkInformation *request,
171  vtkInformationVector **inputVector,
172  vtkInformationVector *outputVector,
173  vtkImageData ***inData,
174  vtkImageData **outData, int ext[6], int id) override;
175 
177  int OutputDimensions[3];
178  double OutputSpacing[3];
179  double MagnificationFactors[3];
182  double CroppingRegion[6];
183 
184  double IndexStretch[3];
185  double IndexTranslate[3];
186 
190 
191 private:
192  vtkImageResize(const vtkImageResize&) = delete;
193  void operator=(const vtkImageResize&) = delete;
194 };
195 
196 #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:48
vtkImageResize::Interpolate
vtkTypeBool Interpolate
Definition: vtkImageResize.h:189
vtkImageResize::OUTPUT_SPACING
Definition: vtkImageResize.h:49
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkImageResize::ResizeMethod
int ResizeMethod
Definition: vtkImageResize.h:176
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageResize::Border
vtkTypeBool Border
Definition: vtkImageResize.h:180
vtkThreadedImageAlgorithm.h
vtkImageResize::NNInterpolator
vtkAbstractImageInterpolator * NNInterpolator
Definition: vtkImageResize.h:188
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:39
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:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageResize::SetResizeMethodToOutputDimensions
void SetResizeMethodToOutputDimensions()
Definition: vtkImageResize.h:62
vtkImageResize::Cropping
vtkTypeBool Cropping
Definition: vtkImageResize.h:181
vtkImageResize::Interpolator
vtkAbstractImageInterpolator * Interpolator
Definition: vtkImageResize.h:187
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkImageResize::SetResizeMethodToMagnificationFactors
void SetResizeMethodToMagnificationFactors()
Definition: vtkImageResize.h:66
vtkImageResize::SetResizeMethodToOutputSpacing
void SetResizeMethodToOutputSpacing()
Definition: vtkImageResize.h:64
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:46
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:302