00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00101 #ifndef __vtkGaussianSplatter_h
00102 #define __vtkGaussianSplatter_h
00103
00104 #include "vtkDataSetToStructuredPointsFilter.h"
00105
00106 #define VTK_ACCUMULATION_MODE_MIN 0
00107 #define VTK_ACCUMULATION_MODE_MAX 1
00108 #define VTK_ACCUMULATION_MODE_SUM 2
00109
00110 class vtkFloatAray;
00111
00112 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToStructuredPointsFilter
00113 {
00114 public:
00115 vtkTypeMacro(vtkGaussianSplatter,vtkDataSetToStructuredPointsFilter);
00116 void PrintSelf(ostream& os, vtkIndent indent);
00117
00121 static vtkGaussianSplatter *New();
00122
00124
00126 void SetSampleDimensions(int i, int j, int k);
00127 void SetSampleDimensions(int dim[3]);
00128 vtkGetVectorMacro(SampleDimensions,int,3);
00130
00132
00136 vtkSetVector6Macro(ModelBounds,float);
00137 vtkGetVectorMacro(ModelBounds,float,6);
00139
00141
00144 vtkSetClampMacro(Radius,float,0.0,1.0);
00145 vtkGetMacro(Radius,float);
00147
00149
00152 vtkSetClampMacro(ScaleFactor,float,0.0,VTK_LARGE_FLOAT);
00153 vtkGetMacro(ScaleFactor,float);
00155
00157
00159 vtkSetMacro(ExponentFactor,float);
00160 vtkGetMacro(ExponentFactor,float);
00162
00164
00167 vtkSetMacro(NormalWarping,int);
00168 vtkGetMacro(NormalWarping,int);
00169 vtkBooleanMacro(NormalWarping,int);
00171
00173
00178 vtkSetClampMacro(Eccentricity,float,0.001,VTK_LARGE_FLOAT);
00179 vtkGetMacro(Eccentricity,float);
00181
00183
00184 vtkSetMacro(ScalarWarping,int);
00185 vtkGetMacro(ScalarWarping,int);
00186 vtkBooleanMacro(ScalarWarping,int);
00188
00190
00193 vtkSetMacro(Capping,int);
00194 vtkGetMacro(Capping,int);
00195 vtkBooleanMacro(Capping,int);
00197
00199
00201 vtkSetMacro(CapValue,float);
00202 vtkGetMacro(CapValue,float);
00204
00206
00210 vtkSetClampMacro(AccumulationMode,int,
00211 VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00212 vtkGetMacro(AccumulationMode,int);
00213 void SetAccumulationModeToMin()
00214 {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00215 void SetAccumulationModeToMax()
00216 {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00217 void SetAccumulationModeToSum()
00218 {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00219 const char *GetAccumulationModeAsString();
00221
00223
00226 vtkSetMacro(NullValue,float);
00227 vtkGetMacro(NullValue,float);
00229
00232 void ComputeModelBounds();
00233
00234 protected:
00235 vtkGaussianSplatter();
00236 ~vtkGaussianSplatter() {};
00237
00238 void Execute();
00239 void Cap(vtkFloatArray *s);
00240
00241 int SampleDimensions[3];
00242 float Radius;
00243 float ExponentFactor;
00244 float ModelBounds[6];
00245 int NormalWarping;
00246 float Eccentricity;
00247 int ScalarWarping;
00248 float ScaleFactor;
00249 int Capping;
00250 float CapValue;
00251 int AccumulationMode;
00252
00253 float Gaussian(float x[3]);
00254 float EccentricGaussian(float x[3]);
00255 float ScalarSampling(float s)
00256 {return this->ScaleFactor * s;}
00257 float PositionSampling(float)
00258 {return this->ScaleFactor;}
00259 void SetScalar(int idx, float dist2);
00260
00261
00262 private:
00263 vtkFloatArray *NewScalars;
00264 float Radius2;
00265 float (vtkGaussianSplatter::*Sample)(float x[3]);
00266 float (vtkGaussianSplatter::*SampleFactor)(float s);
00267 char *Visited;
00268 float Eccentricity2;
00269 float *P;
00270 float *N;
00271 float S;
00272 float Origin[3];
00273 float Spacing[3];
00274 float SplatDistance[3];
00275 float NullValue;
00276
00277
00278 private:
00279 vtkGaussianSplatter(const vtkGaussianSplatter&);
00280 void operator=(const vtkGaussianSplatter&);
00281 };
00282
00283 #endif
00284
00285