VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageBSplineCoefficients.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 =========================================================================*/ 00047 #ifndef __vtkImageBSplineCoefficients_h 00048 #define __vtkImageBSplineCoefficients_h 00049 00050 00051 #include "vtkImagingCoreModule.h" // For export macro 00052 #include "vtkThreadedImageAlgorithm.h" 00053 #include "vtkImageBSplineInterpolator.h" // for constants 00054 00055 class VTKIMAGINGCORE_EXPORT vtkImageBSplineCoefficients : 00056 public vtkThreadedImageAlgorithm 00057 { 00058 public: 00059 static vtkImageBSplineCoefficients *New(); 00060 vtkTypeMacro(vtkImageBSplineCoefficients,vtkThreadedImageAlgorithm); 00061 00062 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 00067 vtkSetClampMacro(SplineDegree, int, 0, VTK_IMAGE_BSPLINE_DEGREE_MAX); 00068 vtkGetMacro(SplineDegree, int); 00070 00072 00079 vtkSetClampMacro(BorderMode, int, 00080 VTK_IMAGE_BORDER_CLAMP, VTK_IMAGE_BORDER_MIRROR); 00081 void SetBorderModeToClamp() { 00082 this->SetBorderMode(VTK_IMAGE_BORDER_CLAMP); } 00083 void SetBorderModeToRepeat() { 00084 this->SetBorderMode(VTK_IMAGE_BORDER_REPEAT); } 00085 void SetBorderModeToMirror() { 00086 this->SetBorderMode(VTK_IMAGE_BORDER_MIRROR); } 00087 vtkGetMacro(BorderMode, int); 00088 const char *GetBorderModeAsString(); 00090 00092 00095 vtkSetClampMacro(OutputScalarType, int, VTK_FLOAT, VTK_DOUBLE); 00096 vtkGetMacro(OutputScalarType, int); 00097 void SetOutputScalarTypeToFloat() { 00098 this->SetOutputScalarType(VTK_FLOAT); } 00099 void SetOutputScalarTypeToDouble() { 00100 this->SetOutputScalarType(VTK_DOUBLE); } 00101 const char *GetOutputScalarTypeAsString(); 00103 00105 00110 vtkSetMacro(Bypass, int); 00111 vtkBooleanMacro(Bypass, int); 00112 vtkGetMacro(Bypass, int); 00114 00119 int CheckBounds(const double point[3]); 00120 00122 00126 void Evaluate(const double point[3], double *value); 00127 double Evaluate(double x, double y, double z); 00128 double Evaluate(const double point[3]) { 00129 return this->Evaluate(point[0], point[1], point[2]); } 00131 00134 int SplitExtent(int splitExt[6], int startExt[6], int num, int total); 00135 00136 protected: 00137 vtkImageBSplineCoefficients(); 00138 ~vtkImageBSplineCoefficients(); 00139 00140 virtual void AllocateOutputData( 00141 vtkImageData *out, vtkInformation *outInfo, int *uExtent); 00142 virtual vtkImageData *AllocateOutputData( 00143 vtkDataObject *out, vtkInformation* outInfo); 00144 00145 virtual int RequestData( 00146 vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00147 virtual int RequestInformation( 00148 vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00149 virtual int RequestUpdateExtent( 00150 vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00151 00152 virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, 00153 int outExt[6], int threadId); 00154 00155 int SplineDegree; 00156 int BorderMode; 00157 int OutputScalarType; 00158 int Bypass; 00159 int DataWasPassed; 00160 int Iteration; 00161 00162 private: 00163 vtkImageBSplineCoefficients(const vtkImageBSplineCoefficients&); // Not implemented. 00164 void operator=(const vtkImageBSplineCoefficients&); // Not implemented. 00165 }; 00166 00167 #endif