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 "vtkThreadedImageAlgorithm.h" 00052 #include "vtkImageBSplineInterpolator.h" // for constants 00053 00054 class VTK_IMAGING_EXPORT vtkImageBSplineCoefficients : 00055 public vtkThreadedImageAlgorithm 00056 { 00057 public: 00058 static vtkImageBSplineCoefficients *New(); 00059 vtkTypeMacro(vtkImageBSplineCoefficients,vtkThreadedImageAlgorithm); 00060 00061 void PrintSelf(ostream& os, vtkIndent indent); 00062 00064 00066 vtkSetClampMacro(SplineDegree, int, 0, VTK_IMAGE_BSPLINE_DEGREE_MAX); 00067 vtkGetMacro(SplineDegree, int); 00069 00071 00078 vtkSetClampMacro(BorderMode, int, 00079 VTK_IMAGE_BORDER_CLAMP, VTK_IMAGE_BORDER_MIRROR); 00080 void SetBorderModeToClamp() { 00081 this->SetBorderMode(VTK_IMAGE_BORDER_CLAMP); } 00082 void SetBorderModeToRepeat() { 00083 this->SetBorderMode(VTK_IMAGE_BORDER_REPEAT); } 00084 void SetBorderModeToMirror() { 00085 this->SetBorderMode(VTK_IMAGE_BORDER_MIRROR); } 00086 vtkGetMacro(BorderMode, int); 00087 const char *GetBorderModeAsString(); 00089 00091 00094 vtkSetClampMacro(OutputScalarType, int, VTK_FLOAT, VTK_DOUBLE); 00095 vtkGetMacro(OutputScalarType, int); 00096 void SetOutputScalarTypeToFloat() { 00097 this->SetOutputScalarType(VTK_FLOAT); } 00098 void SetOutputScalarTypeToDouble() { 00099 this->SetOutputScalarType(VTK_DOUBLE); } 00100 const char *GetOutputScalarTypeAsString(); 00102 00104 00109 vtkSetMacro(Bypass, int); 00110 vtkBooleanMacro(Bypass, int); 00111 vtkGetMacro(Bypass, int); 00113 00118 int CheckBounds(const double point[3]); 00119 00121 00125 void Evaluate(const double point[3], double *value); 00126 double Evaluate(double x, double y, double z); 00127 double Evaluate(const double point[3]) { 00128 return this->Evaluate(point[0], point[1], point[2]); } 00130 00133 int SplitExtent(int splitExt[6], int startExt[6], int num, int total); 00134 00135 protected: 00136 vtkImageBSplineCoefficients(); 00137 ~vtkImageBSplineCoefficients(); 00138 00139 virtual void AllocateOutputData(vtkImageData *out, int *uExtent); 00140 virtual vtkImageData *AllocateOutputData(vtkDataObject *out); 00141 00142 virtual int RequestData( 00143 vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00144 virtual int RequestInformation( 00145 vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00146 virtual int RequestUpdateExtent( 00147 vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00148 00149 virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, 00150 int outExt[6], int threadId); 00151 00152 int SplineDegree; 00153 int BorderMode; 00154 int OutputScalarType; 00155 int Bypass; 00156 int DataWasPassed; 00157 int Iteration; 00158 00159 private: 00160 vtkImageBSplineCoefficients(const vtkImageBSplineCoefficients&); // Not implemented. 00161 void operator=(const vtkImageBSplineCoefficients&); // Not implemented. 00162 }; 00163 00164 #endif