00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00073 #ifndef __vtkGaussianSplatter_h
00074 #define __vtkGaussianSplatter_h
00075
00076 #include "vtkImageAlgorithm.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 vtkImageAlgorithm
00085 {
00086 public:
00087 vtkTypeRevisionMacro(vtkGaussianSplatter,vtkImageAlgorithm);
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
00203
00205 void ComputeModelBounds(vtkDataSet *input, vtkImageData *output,
00206 vtkInformation *outInfo);
00208
00209 protected:
00210 vtkGaussianSplatter();
00211 ~vtkGaussianSplatter() {};
00212
00213 virtual int FillInputPortInformation(int port, vtkInformation* info);
00214 virtual int RequestInformation (vtkInformation *,
00215 vtkInformationVector **,
00216 vtkInformationVector *);
00217 virtual int RequestData(vtkInformation *,
00218 vtkInformationVector **,
00219 vtkInformationVector *);
00220 void Cap(vtkDoubleArray *s);
00221
00222 int SampleDimensions[3];
00223 double Radius;
00224 double ExponentFactor;
00225 double ModelBounds[6];
00226 int NormalWarping;
00227 double Eccentricity;
00228 int ScalarWarping;
00229 double ScaleFactor;
00230 int Capping;
00231 double CapValue;
00232 int AccumulationMode;
00233
00234 double Gaussian(double x[3]);
00235 double EccentricGaussian(double x[3]);
00236 double ScalarSampling(double s)
00237 {return this->ScaleFactor * s;}
00238 double PositionSampling(double)
00239 {return this->ScaleFactor;}
00240 void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
00241
00242
00243 private:
00244 double Radius2;
00245 double (vtkGaussianSplatter::*Sample)(double x[3]);
00246 double (vtkGaussianSplatter::*SampleFactor)(double s);
00247 char *Visited;
00248 double Eccentricity2;
00249 double *P;
00250 double *N;
00251 double S;
00252 double Origin[3];
00253 double Spacing[3];
00254 double SplatDistance[3];
00255 double NullValue;
00256
00257
00258 private:
00259 vtkGaussianSplatter(const vtkGaussianSplatter&);
00260 void operator=(const vtkGaussianSplatter&);
00261 };
00262
00263 #endif
00264
00265