00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00089 #ifndef __vtkGaussianSplatter_h
00090 #define __vtkGaussianSplatter_h
00091
00092 #include "vtkDataSetToImageFilter.h"
00093
00094 #define VTK_ACCUMULATION_MODE_MIN 0
00095 #define VTK_ACCUMULATION_MODE_MAX 1
00096 #define VTK_ACCUMULATION_MODE_SUM 2
00097
00098 class vtkFloatArray;
00099
00100 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToImageFilter
00101 {
00102 public:
00103 vtkTypeRevisionMacro(vtkGaussianSplatter,vtkDataSetToImageFilter);
00104 void PrintSelf(ostream& os, vtkIndent indent);
00105
00109 static vtkGaussianSplatter *New();
00110
00112
00114 void SetSampleDimensions(int i, int j, int k);
00115 void SetSampleDimensions(int dim[3]);
00116 vtkGetVectorMacro(SampleDimensions,int,3);
00118
00120
00124 vtkSetVector6Macro(ModelBounds,float);
00125 vtkGetVectorMacro(ModelBounds,float,6);
00127
00129
00132 vtkSetClampMacro(Radius,float,0.0,1.0);
00133 vtkGetMacro(Radius,float);
00135
00137
00140 vtkSetClampMacro(ScaleFactor,float,0.0,VTK_LARGE_FLOAT);
00141 vtkGetMacro(ScaleFactor,float);
00143
00145
00147 vtkSetMacro(ExponentFactor,float);
00148 vtkGetMacro(ExponentFactor,float);
00150
00152
00155 vtkSetMacro(NormalWarping,int);
00156 vtkGetMacro(NormalWarping,int);
00157 vtkBooleanMacro(NormalWarping,int);
00159
00161
00166 vtkSetClampMacro(Eccentricity,float,0.001,VTK_LARGE_FLOAT);
00167 vtkGetMacro(Eccentricity,float);
00169
00171
00172 vtkSetMacro(ScalarWarping,int);
00173 vtkGetMacro(ScalarWarping,int);
00174 vtkBooleanMacro(ScalarWarping,int);
00176
00178
00181 vtkSetMacro(Capping,int);
00182 vtkGetMacro(Capping,int);
00183 vtkBooleanMacro(Capping,int);
00185
00187
00189 vtkSetMacro(CapValue,float);
00190 vtkGetMacro(CapValue,float);
00192
00194
00198 vtkSetClampMacro(AccumulationMode,int,
00199 VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00200 vtkGetMacro(AccumulationMode,int);
00201 void SetAccumulationModeToMin()
00202 {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00203 void SetAccumulationModeToMax()
00204 {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00205 void SetAccumulationModeToSum()
00206 {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00207 const char *GetAccumulationModeAsString();
00209
00211
00214 vtkSetMacro(NullValue,float);
00215 vtkGetMacro(NullValue,float);
00217
00220 void ComputeModelBounds();
00221
00222 protected:
00223 vtkGaussianSplatter();
00224 ~vtkGaussianSplatter() {};
00225
00226 virtual void ExecuteInformation();
00227 virtual void ExecuteData(vtkDataObject *);
00228 void Cap(vtkFloatArray *s);
00229
00230 int SampleDimensions[3];
00231 float Radius;
00232 float ExponentFactor;
00233 float ModelBounds[6];
00234 int NormalWarping;
00235 float Eccentricity;
00236 int ScalarWarping;
00237 float ScaleFactor;
00238 int Capping;
00239 float CapValue;
00240 int AccumulationMode;
00241
00242 float Gaussian(float x[3]);
00243 float EccentricGaussian(float x[3]);
00244 float ScalarSampling(float s)
00245 {return this->ScaleFactor * s;}
00246 float PositionSampling(float)
00247 {return this->ScaleFactor;}
00248 void SetScalar(int idx, float dist2, vtkFloatArray *newScalars);
00249
00250
00251 private:
00252 float Radius2;
00253 float (vtkGaussianSplatter::*Sample)(float x[3]);
00254 float (vtkGaussianSplatter::*SampleFactor)(float s);
00255 char *Visited;
00256 float Eccentricity2;
00257 float *P;
00258 float *N;
00259 float S;
00260 float Origin[3];
00261 float Spacing[3];
00262 float SplatDistance[3];
00263 float NullValue;
00264
00265
00266 private:
00267 vtkGaussianSplatter(const vtkGaussianSplatter&);
00268 void operator=(const vtkGaussianSplatter&);
00269 };
00270
00271 #endif
00272
00273