VTK
vtkGaussianSplatter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGaussianSplatter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
73 #ifndef __vtkGaussianSplatter_h
74 #define __vtkGaussianSplatter_h
75 
76 #include "vtkImageAlgorithm.h"
77 
78 #define VTK_ACCUMULATION_MODE_MIN 0
79 #define VTK_ACCUMULATION_MODE_MAX 1
80 #define VTK_ACCUMULATION_MODE_SUM 2
81 
82 class vtkDoubleArray;
83 
85 {
86 public:
88  void PrintSelf(ostream& os, vtkIndent indent);
89 
93  static vtkGaussianSplatter *New();
94 
96 
98  void SetSampleDimensions(int i, int j, int k);
99  void SetSampleDimensions(int dim[3]);
100  vtkGetVectorMacro(SampleDimensions,int,3);
102 
104 
108  vtkSetVector6Macro(ModelBounds,double);
109  vtkGetVectorMacro(ModelBounds,double,6);
111 
113 
116  vtkSetClampMacro(Radius,double,0.0,1.0);
117  vtkGetMacro(Radius,double);
119 
121 
124  vtkSetClampMacro(ScaleFactor,double,0.0,VTK_DOUBLE_MAX);
125  vtkGetMacro(ScaleFactor,double);
127 
129 
131  vtkSetMacro(ExponentFactor,double);
132  vtkGetMacro(ExponentFactor,double);
134 
136 
139  vtkSetMacro(NormalWarping,int);
140  vtkGetMacro(NormalWarping,int);
141  vtkBooleanMacro(NormalWarping,int);
143 
145 
150  vtkSetClampMacro(Eccentricity,double,0.001,VTK_DOUBLE_MAX);
151  vtkGetMacro(Eccentricity,double);
153 
155 
156  vtkSetMacro(ScalarWarping,int);
157  vtkGetMacro(ScalarWarping,int);
158  vtkBooleanMacro(ScalarWarping,int);
160 
162 
165  vtkSetMacro(Capping,int);
166  vtkGetMacro(Capping,int);
167  vtkBooleanMacro(Capping,int);
169 
171 
173  vtkSetMacro(CapValue,double);
174  vtkGetMacro(CapValue,double);
176 
178 
182  vtkSetClampMacro(AccumulationMode,int,
184  vtkGetMacro(AccumulationMode,int);
186  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
188  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
190  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
191  const char *GetAccumulationModeAsString();
193 
195 
198  vtkSetMacro(NullValue,double);
199  vtkGetMacro(NullValue,double);
201 
203 
205  void ComputeModelBounds(vtkDataSet *input, vtkImageData *output,
206  vtkInformation *outInfo);
208 
209 protected:
212 
214  virtual int RequestInformation (vtkInformation *,
217  virtual int RequestData(vtkInformation *,
220  void Cap(vtkDoubleArray *s);
221 
222  int SampleDimensions[3]; // dimensions of volume to splat into
223  double Radius; // maximum distance splat propagates (as fraction 0->1)
224  double ExponentFactor; // scale exponent of gaussian function
225  double ModelBounds[6]; // bounding box of splatting dimensions
226  int NormalWarping; // on/off warping of splat via normal
227  double Eccentricity;// elliptic distortion due to normals
228  int ScalarWarping; // on/off warping of splat via scalar
229  double ScaleFactor; // splat size influenced by scale factor
230  int Capping; // Cap side of volume to close surfaces
231  double CapValue; // value to use for capping
232  int AccumulationMode; // how to combine scalar values
233 
234  double Gaussian(double x[3]);
235  double EccentricGaussian(double x[3]);
236  double ScalarSampling(double s)
237  {return this->ScaleFactor * s;}
238  double PositionSampling(double)
239  {return this->ScaleFactor;}
240  void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
241 
242 //BTX
243 private:
244  double Radius2;
245  double (vtkGaussianSplatter::*Sample)(double x[3]);
246  double (vtkGaussianSplatter::*SampleFactor)(double s);
247  char *Visited;
248  double Eccentricity2;
249  double *P;
250  double *N;
251  double S;
252  double Origin[3];
253  double Spacing[3];
254  double SplatDistance[3];
255  double NullValue;
256 //ETX
257 
258 private:
259  vtkGaussianSplatter(const vtkGaussianSplatter&); // Not implemented.
260  void operator=(const vtkGaussianSplatter&); // Not implemented.
261 };
262 
263 #endif
264 
265 
#define VTK_DOUBLE_MAX
Definition: vtkType.h:133
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:58
#define VTK_ACCUMULATION_MODE_MAX
splat points into a volume with an elliptical, Gaussian distribution
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_IMAGING_EXPORT
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
double PositionSampling(double)
#define VTK_ACCUMULATION_MODE_SUM
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTK_ACCUMULATION_MODE_MIN
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
double ScalarSampling(double s)