Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00077 #ifndef __vtkGaussianSplatter_h
00078 #define __vtkGaussianSplatter_h
00079 
00080 #include "vtkDataSetToImageFilter.h"
00081 
00082 #define VTK_ACCUMULATION_MODE_MIN 0
00083 #define VTK_ACCUMULATION_MODE_MAX 1
00084 #define VTK_ACCUMULATION_MODE_SUM 2
00085 
00086 class vtkFloatArray;
00087 
00088 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToImageFilter 
00089 {
00090 public:
00091   vtkTypeRevisionMacro(vtkGaussianSplatter,vtkDataSetToImageFilter);
00092   void PrintSelf(ostream& os, vtkIndent indent);
00093 
00097   static vtkGaussianSplatter *New();
00098 
00100 
00102   void SetSampleDimensions(int i, int j, int k);
00103   void SetSampleDimensions(int dim[3]);
00104   vtkGetVectorMacro(SampleDimensions,int,3);
00106 
00108 
00112   vtkSetVector6Macro(ModelBounds,float);
00113   vtkGetVectorMacro(ModelBounds,float,6);
00115 
00117 
00120   vtkSetClampMacro(Radius,float,0.0,1.0);
00121   vtkGetMacro(Radius,float);
00123 
00125 
00128   vtkSetClampMacro(ScaleFactor,float,0.0,VTK_LARGE_FLOAT);
00129   vtkGetMacro(ScaleFactor,float);
00131 
00133 
00135   vtkSetMacro(ExponentFactor,float);
00136   vtkGetMacro(ExponentFactor,float);
00138 
00140 
00143   vtkSetMacro(NormalWarping,int);
00144   vtkGetMacro(NormalWarping,int);
00145   vtkBooleanMacro(NormalWarping,int);
00147 
00149 
00154   vtkSetClampMacro(Eccentricity,float,0.001,VTK_LARGE_FLOAT);
00155   vtkGetMacro(Eccentricity,float);
00157 
00159 
00160   vtkSetMacro(ScalarWarping,int);
00161   vtkGetMacro(ScalarWarping,int);
00162   vtkBooleanMacro(ScalarWarping,int);
00164 
00166 
00169   vtkSetMacro(Capping,int);
00170   vtkGetMacro(Capping,int);
00171   vtkBooleanMacro(Capping,int);
00173   
00175 
00177   vtkSetMacro(CapValue,float);
00178   vtkGetMacro(CapValue,float);
00180 
00182 
00186   vtkSetClampMacro(AccumulationMode,int,
00187                    VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00188   vtkGetMacro(AccumulationMode,int);
00189   void SetAccumulationModeToMin()
00190     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00191   void SetAccumulationModeToMax()
00192     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00193   void SetAccumulationModeToSum()
00194     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00195   const char *GetAccumulationModeAsString();
00197 
00199 
00202   vtkSetMacro(NullValue,float);
00203   vtkGetMacro(NullValue,float);
00205 
00208   void ComputeModelBounds();
00209 
00210 protected:
00211   vtkGaussianSplatter();
00212   ~vtkGaussianSplatter() {};
00213 
00214   virtual void ExecuteInformation();
00215   virtual void ExecuteData(vtkDataObject *);
00216   void Cap(vtkFloatArray *s);
00217 
00218   int SampleDimensions[3]; // dimensions of volume to splat into
00219   float Radius; // maximum distance splat propagates (as fraction 0->1)
00220   float ExponentFactor; // scale exponent of gaussian function
00221   float ModelBounds[6]; // bounding box of splatting dimensions
00222   int NormalWarping; // on/off warping of splat via normal
00223   float Eccentricity;// elliptic distortion due to normals
00224   int ScalarWarping; // on/off warping of splat via scalar
00225   float ScaleFactor; // splat size influenced by scale factor
00226   int Capping; // Cap side of volume to close surfaces
00227   float CapValue; // value to use for capping
00228   int AccumulationMode; // how to combine scalar values
00229 
00230   float Gaussian(float x[3]);  
00231   float EccentricGaussian(float x[3]);  
00232   float ScalarSampling(float s) 
00233     {return this->ScaleFactor * s;}
00234   float PositionSampling(float) 
00235     {return this->ScaleFactor;}
00236   void SetScalar(int idx, float dist2, vtkFloatArray *newScalars);
00237 
00238 //BTX
00239 private:
00240   float Radius2;
00241   float (vtkGaussianSplatter::*Sample)(float x[3]);
00242   float (vtkGaussianSplatter::*SampleFactor)(float s);
00243   char *Visited;
00244   float Eccentricity2;
00245   float *P;
00246   float *N;
00247   float S;
00248   float Origin[3];
00249   float Spacing[3];
00250   float SplatDistance[3];
00251   float NullValue;
00252 //ETX
00253 
00254 private:
00255   vtkGaussianSplatter(const vtkGaussianSplatter&);  // Not implemented.
00256   void operator=(const vtkGaussianSplatter&);  // Not implemented.
00257 };
00258 
00259 #endif
00260 
00261