00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
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];
00219 float Radius;
00220 float ExponentFactor;
00221 float ModelBounds[6];
00222 int NormalWarping;
00223 float Eccentricity;
00224 int ScalarWarping;
00225 float ScaleFactor;
00226 int Capping;
00227 float CapValue;
00228 int AccumulationMode;
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
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
00253
00254
private:
00255 vtkGaussianSplatter(
const vtkGaussianSplatter&);
00256
void operator=(
const vtkGaussianSplatter&);
00257 };
00258
00259
#endif
00260
00261