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

Imaging/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 =========================================================================*/
00073 #ifndef __vtkGaussianSplatter_h
00074 #define __vtkGaussianSplatter_h
00075 
00076 #include "vtkDataSetToImageFilter.h"
00077 
00078 #define VTK_ACCUMULATION_MODE_MIN 0
00079 #define VTK_ACCUMULATION_MODE_MAX 1
00080 #define VTK_ACCUMULATION_MODE_SUM 2
00081 
00082 class vtkDoubleArray;
00083 
00084 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToImageFilter 
00085 {
00086 public:
00087   vtkTypeRevisionMacro(vtkGaussianSplatter,vtkDataSetToImageFilter);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00093   static vtkGaussianSplatter *New();
00094 
00096 
00098   void SetSampleDimensions(int i, int j, int k);
00099   void SetSampleDimensions(int dim[3]);
00100   vtkGetVectorMacro(SampleDimensions,int,3);
00102 
00104 
00108   vtkSetVector6Macro(ModelBounds,double);
00109   vtkGetVectorMacro(ModelBounds,double,6);
00111 
00113 
00116   vtkSetClampMacro(Radius,double,0.0,1.0);
00117   vtkGetMacro(Radius,double);
00119 
00121 
00124   vtkSetClampMacro(ScaleFactor,double,0.0,VTK_DOUBLE_MAX);
00125   vtkGetMacro(ScaleFactor,double);
00127 
00129 
00131   vtkSetMacro(ExponentFactor,double);
00132   vtkGetMacro(ExponentFactor,double);
00134 
00136 
00139   vtkSetMacro(NormalWarping,int);
00140   vtkGetMacro(NormalWarping,int);
00141   vtkBooleanMacro(NormalWarping,int);
00143 
00145 
00150   vtkSetClampMacro(Eccentricity,double,0.001,VTK_DOUBLE_MAX);
00151   vtkGetMacro(Eccentricity,double);
00153 
00155 
00156   vtkSetMacro(ScalarWarping,int);
00157   vtkGetMacro(ScalarWarping,int);
00158   vtkBooleanMacro(ScalarWarping,int);
00160 
00162 
00165   vtkSetMacro(Capping,int);
00166   vtkGetMacro(Capping,int);
00167   vtkBooleanMacro(Capping,int);
00169   
00171 
00173   vtkSetMacro(CapValue,double);
00174   vtkGetMacro(CapValue,double);
00176 
00178 
00182   vtkSetClampMacro(AccumulationMode,int,
00183                    VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00184   vtkGetMacro(AccumulationMode,int);
00185   void SetAccumulationModeToMin()
00186     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00187   void SetAccumulationModeToMax()
00188     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00189   void SetAccumulationModeToSum()
00190     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00191   const char *GetAccumulationModeAsString();
00193 
00195 
00198   vtkSetMacro(NullValue,double);
00199   vtkGetMacro(NullValue,double);
00201 
00204   void ComputeModelBounds();
00205 
00206 protected:
00207   vtkGaussianSplatter();
00208   ~vtkGaussianSplatter() {};
00209 
00210   virtual void ExecuteInformation();
00211   virtual void ExecuteData(vtkDataObject *);
00212   void Cap(vtkDoubleArray *s);
00213 
00214   int SampleDimensions[3]; // dimensions of volume to splat into
00215   double Radius; // maximum distance splat propagates (as fraction 0->1)
00216   double ExponentFactor; // scale exponent of gaussian function
00217   double ModelBounds[6]; // bounding box of splatting dimensions
00218   int NormalWarping; // on/off warping of splat via normal
00219   double Eccentricity;// elliptic distortion due to normals
00220   int ScalarWarping; // on/off warping of splat via scalar
00221   double ScaleFactor; // splat size influenced by scale factor
00222   int Capping; // Cap side of volume to close surfaces
00223   double CapValue; // value to use for capping
00224   int AccumulationMode; // how to combine scalar values
00225 
00226   double Gaussian(double x[3]);  
00227   double EccentricGaussian(double x[3]);  
00228   double ScalarSampling(double s) 
00229     {return this->ScaleFactor * s;}
00230   double PositionSampling(double) 
00231     {return this->ScaleFactor;}
00232   void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
00233 
00234 //BTX
00235 private:
00236   double Radius2;
00237   double (vtkGaussianSplatter::*Sample)(double x[3]);
00238   double (vtkGaussianSplatter::*SampleFactor)(double s);
00239   char *Visited;
00240   double Eccentricity2;
00241   double *P;
00242   double *N;
00243   double S;
00244   double Origin[3];
00245   double Spacing[3];
00246   double SplatDistance[3];
00247   double NullValue;
00248 //ETX
00249 
00250 private:
00251   vtkGaussianSplatter(const vtkGaussianSplatter&);  // Not implemented.
00252   void operator=(const vtkGaussianSplatter&);  // Not implemented.
00253 };
00254 
00255 #endif
00256 
00257