00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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];
00227 double Radius;
00228 double ExponentFactor;
00229 double ModelBounds[6];
00230 int NormalWarping;
00231 double Eccentricity;
00232 int ScalarWarping;
00233 double ScaleFactor;
00234 int Capping;
00235 double CapValue;
00236 int AccumulationMode;
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
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
00261
00262 private:
00263 vtkGaussianSplatter(const vtkGaussianSplatter&);
00264 void operator=(const vtkGaussianSplatter&);
00265 };
00266
00267 #endif
00268
00269