VTK
dox/Imaging/vtkImageResize.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageResize.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00033 #ifndef __vtkImageResize_h
00034 #define __vtkImageResize_h
00035 
00036 #include "vtkThreadedImageAlgorithm.h"
00037 
00038 class vtkAbstractImageInterpolator;
00039 
00040 class VTK_IMAGING_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm
00041 {
00042 public:
00043   static vtkImageResize *New();
00044   vtkTypeMacro(vtkImageResize, vtkThreadedImageAlgorithm);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00047   enum
00048     {
00049     OUTPUT_DIMENSIONS,
00050     OUTPUT_SPACING,
00051     MAGNIFICATION_FACTORS
00052     };
00053 
00055 
00059   vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS);
00060   vtkGetMacro(ResizeMethod, int);
00061   void SetResizeMethodToOutputDimensions() {
00062     this->SetResizeMethod(OUTPUT_DIMENSIONS); }
00063   void SetResizeMethodToOutputSpacing() {
00064     this->SetResizeMethod(OUTPUT_SPACING); }
00065   void SetResizeMethodToMagnificationFactors() {
00066     this->SetResizeMethod(MAGNIFICATION_FACTORS); }
00067   virtual const char *GetResizeMethodAsString();
00069 
00071 
00074   vtkSetVector3Macro(OutputDimensions, int);
00075   vtkGetVector3Macro(OutputDimensions, int);
00077 
00079 
00082   vtkSetVector3Macro(OutputSpacing, double);
00083   vtkGetVector3Macro(OutputSpacing, double);
00085 
00087 
00090   vtkSetVector3Macro(MagnificationFactors, double);
00091   vtkGetVector3Macro(MagnificationFactors, double);
00093 
00095 
00103   vtkSetMacro(Border, int);
00104   vtkBooleanMacro(Border, int);
00105   vtkGetMacro(Border, int);
00107 
00109 
00111   vtkSetMacro(Cropping, int);
00112   vtkBooleanMacro(Cropping, int);
00113   vtkGetMacro(Cropping, int);
00115 
00117 
00120   vtkSetVector6Macro(CroppingRegion, double);
00121   vtkGetVector6Macro(CroppingRegion, double);
00123 
00125 
00126   vtkSetMacro(Interpolate, int);
00127   vtkBooleanMacro(Interpolate, int);
00128   vtkGetMacro(Interpolate, int);
00130 
00132 
00133   virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
00134   virtual vtkAbstractImageInterpolator *GetInterpolator();
00136 
00138   unsigned long int GetMTime();
00139 
00140 protected:
00141   vtkImageResize();
00142   ~vtkImageResize();
00143 
00144   virtual vtkAbstractImageInterpolator *GetInternalInterpolator();
00145 
00146   virtual int RequestInformation(vtkInformation *, vtkInformationVector **,
00147                                  vtkInformationVector *);
00148   virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
00149                                   vtkInformationVector *);
00150   virtual int RequestData(vtkInformation *, vtkInformationVector **,
00151                           vtkInformationVector *);
00152   virtual void ThreadedRequestData(vtkInformation *request,
00153                                    vtkInformationVector **inputVector,
00154                                    vtkInformationVector *outputVector,
00155                                    vtkImageData ***inData,
00156                                    vtkImageData **outData, int ext[6], int id);
00157 
00158   int ResizeMethod;
00159   int OutputDimensions[3];
00160   double OutputSpacing[3];
00161   double MagnificationFactors[3];
00162   int Border;
00163   int Cropping;
00164   double CroppingRegion[6];
00165 
00166   double IndexStretch[3];
00167   double IndexTranslate[3];
00168 
00169   vtkAbstractImageInterpolator *Interpolator;
00170   vtkAbstractImageInterpolator *NNInterpolator;
00171   int Interpolate;
00172 
00173 private:
00174   vtkImageResize(const vtkImageResize&);  // Not implemented.
00175   void operator=(const vtkImageResize&);  // Not implemented.
00176 };
00177 
00178 #endif