VTK
|
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 "vtkImagingCoreModule.h" // For export macro 00037 #include "vtkThreadedImageAlgorithm.h" 00038 00039 class vtkAbstractImageInterpolator; 00040 00041 class VTKIMAGINGCORE_EXPORT vtkImageResize : public vtkThreadedImageAlgorithm 00042 { 00043 public: 00044 static vtkImageResize *New(); 00045 vtkTypeMacro(vtkImageResize, vtkThreadedImageAlgorithm); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00048 enum 00049 { 00050 OUTPUT_DIMENSIONS, 00051 OUTPUT_SPACING, 00052 MAGNIFICATION_FACTORS 00053 }; 00054 00056 00060 vtkSetClampMacro(ResizeMethod, int, OUTPUT_DIMENSIONS, MAGNIFICATION_FACTORS); 00061 vtkGetMacro(ResizeMethod, int); 00062 void SetResizeMethodToOutputDimensions() { 00063 this->SetResizeMethod(OUTPUT_DIMENSIONS); } 00064 void SetResizeMethodToOutputSpacing() { 00065 this->SetResizeMethod(OUTPUT_SPACING); } 00066 void SetResizeMethodToMagnificationFactors() { 00067 this->SetResizeMethod(MAGNIFICATION_FACTORS); } 00068 virtual const char *GetResizeMethodAsString(); 00070 00072 00075 vtkSetVector3Macro(OutputDimensions, int); 00076 vtkGetVector3Macro(OutputDimensions, int); 00078 00080 00083 vtkSetVector3Macro(OutputSpacing, double); 00084 vtkGetVector3Macro(OutputSpacing, double); 00086 00088 00091 vtkSetVector3Macro(MagnificationFactors, double); 00092 vtkGetVector3Macro(MagnificationFactors, double); 00094 00096 00104 vtkSetMacro(Border, int); 00105 vtkBooleanMacro(Border, int); 00106 vtkGetMacro(Border, int); 00108 00110 00112 vtkSetMacro(Cropping, int); 00113 vtkBooleanMacro(Cropping, int); 00114 vtkGetMacro(Cropping, int); 00116 00118 00121 vtkSetVector6Macro(CroppingRegion, double); 00122 vtkGetVector6Macro(CroppingRegion, double); 00124 00126 00127 vtkSetMacro(Interpolate, int); 00128 vtkBooleanMacro(Interpolate, int); 00129 vtkGetMacro(Interpolate, int); 00131 00133 00134 virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler); 00135 virtual vtkAbstractImageInterpolator *GetInterpolator(); 00137 00139 unsigned long int GetMTime(); 00140 00141 protected: 00142 vtkImageResize(); 00143 ~vtkImageResize(); 00144 00145 virtual vtkAbstractImageInterpolator *GetInternalInterpolator(); 00146 00147 virtual int RequestInformation(vtkInformation *, vtkInformationVector **, 00148 vtkInformationVector *); 00149 virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, 00150 vtkInformationVector *); 00151 virtual int RequestData(vtkInformation *, vtkInformationVector **, 00152 vtkInformationVector *); 00153 virtual void ThreadedRequestData(vtkInformation *request, 00154 vtkInformationVector **inputVector, 00155 vtkInformationVector *outputVector, 00156 vtkImageData ***inData, 00157 vtkImageData **outData, int ext[6], int id); 00158 00159 int ResizeMethod; 00160 int OutputDimensions[3]; 00161 double OutputSpacing[3]; 00162 double MagnificationFactors[3]; 00163 int Border; 00164 int Cropping; 00165 double CroppingRegion[6]; 00166 00167 double IndexStretch[3]; 00168 double IndexTranslate[3]; 00169 00170 vtkAbstractImageInterpolator *Interpolator; 00171 vtkAbstractImageInterpolator *NNInterpolator; 00172 int Interpolate; 00173 00174 private: 00175 vtkImageResize(const vtkImageResize&); // Not implemented. 00176 void operator=(const vtkImageResize&); // Not implemented. 00177 }; 00178 00179 #endif