Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkGaussianSplatter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGaussianSplatter.h,v $
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 =========================================================================*/
00085 #ifndef __vtkGaussianSplatter_h
00086 #define __vtkGaussianSplatter_h
00087 
00088 #include "vtkDataSetToImageFilter.h"
00089 
00090 #define VTK_ACCUMULATION_MODE_MIN 0
00091 #define VTK_ACCUMULATION_MODE_MAX 1
00092 #define VTK_ACCUMULATION_MODE_SUM 2
00093 
00094 class vtkDoubleArray;
00095 
00096 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToImageFilter 
00097 {
00098 public:
00099   vtkTypeRevisionMacro(vtkGaussianSplatter,vtkDataSetToImageFilter);
00100   void PrintSelf(ostream& os, vtkIndent indent);
00101 
00105   static vtkGaussianSplatter *New();
00106 
00108 
00110   void SetSampleDimensions(int i, int j, int k);
00111   void SetSampleDimensions(int dim[3]);
00112   vtkGetVectorMacro(SampleDimensions,int,3);
00114 
00116 
00120   vtkSetVector6Macro(ModelBounds,double);
00121   vtkGetVectorMacro(ModelBounds,double,6);
00123 
00125 
00128   vtkSetClampMacro(Radius,double,0.0,1.0);
00129   vtkGetMacro(Radius,double);
00131 
00133 
00136   vtkSetClampMacro(ScaleFactor,double,0.0,VTK_DOUBLE_MAX);
00137   vtkGetMacro(ScaleFactor,double);
00139 
00141 
00143   vtkSetMacro(ExponentFactor,double);
00144   vtkGetMacro(ExponentFactor,double);
00146 
00148 
00151   vtkSetMacro(NormalWarping,int);
00152   vtkGetMacro(NormalWarping,int);
00153   vtkBooleanMacro(NormalWarping,int);
00155 
00157 
00162   vtkSetClampMacro(Eccentricity,double,0.001,VTK_DOUBLE_MAX);
00163   vtkGetMacro(Eccentricity,double);
00165 
00167 
00168   vtkSetMacro(ScalarWarping,int);
00169   vtkGetMacro(ScalarWarping,int);
00170   vtkBooleanMacro(ScalarWarping,int);
00172 
00174 
00177   vtkSetMacro(Capping,int);
00178   vtkGetMacro(Capping,int);
00179   vtkBooleanMacro(Capping,int);
00181   
00183 
00185   vtkSetMacro(CapValue,double);
00186   vtkGetMacro(CapValue,double);
00188 
00190 
00194   vtkSetClampMacro(AccumulationMode,int,
00195                    VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00196   vtkGetMacro(AccumulationMode,int);
00197   void SetAccumulationModeToMin()
00198     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00199   void SetAccumulationModeToMax()
00200     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00201   void SetAccumulationModeToSum()
00202     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00203   const char *GetAccumulationModeAsString();
00205 
00207 
00210   vtkSetMacro(NullValue,double);
00211   vtkGetMacro(NullValue,double);
00213 
00216   void ComputeModelBounds();
00217 
00218 protected:
00219   vtkGaussianSplatter();
00220   ~vtkGaussianSplatter() {};
00221 
00222   virtual void ExecuteInformation();
00223   virtual void ExecuteData(vtkDataObject *);
00224   void Cap(vtkDoubleArray *s);
00225 
00226   int SampleDimensions[3]; // dimensions of volume to splat into
00227   double Radius; // maximum distance splat propagates (as fraction 0->1)
00228   double ExponentFactor; // scale exponent of gaussian function
00229   double ModelBounds[6]; // bounding box of splatting dimensions
00230   int NormalWarping; // on/off warping of splat via normal
00231   double Eccentricity;// elliptic distortion due to normals
00232   int ScalarWarping; // on/off warping of splat via scalar
00233   double ScaleFactor; // splat size influenced by scale factor
00234   int Capping; // Cap side of volume to close surfaces
00235   double CapValue; // value to use for capping
00236   int AccumulationMode; // how to combine scalar values
00237 
00238   double Gaussian(double x[3]);  
00239   double EccentricGaussian(double x[3]);  
00240   double ScalarSampling(double s) 
00241     {return this->ScaleFactor * s;}
00242   double PositionSampling(double) 
00243     {return this->ScaleFactor;}
00244   void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
00245 
00246 //BTX
00247 private:
00248   double Radius2;
00249   double (vtkGaussianSplatter::*Sample)(double x[3]);
00250   double (vtkGaussianSplatter::*SampleFactor)(double s);
00251   char *Visited;
00252   double Eccentricity2;
00253   double *P;
00254   double *N;
00255   double S;
00256   double Origin[3];
00257   double Spacing[3];
00258   double SplatDistance[3];
00259   double NullValue;
00260 //ETX
00261 
00262 private:
00263   vtkGaussianSplatter(const vtkGaussianSplatter&);  // Not implemented.
00264   void operator=(const vtkGaussianSplatter&);  // Not implemented.
00265 };
00266 
00267 #endif
00268 
00269