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 "vtkImagingHybridModule.h" // For export macro
77 #include "vtkImageAlgorithm.h"
78 
79 #define VTK_ACCUMULATION_MODE_MIN 0
80 #define VTK_ACCUMULATION_MODE_MAX 1
81 #define VTK_ACCUMULATION_MODE_SUM 2
82 
83 class vtkDoubleArray;
85 
87 {
88 public:
90  void PrintSelf(ostream& os, vtkIndent indent);
91 
95  static vtkGaussianSplatter *New();
96 
98 
100  void SetSampleDimensions(int i, int j, int k);
101  void SetSampleDimensions(int dim[3]);
102  vtkGetVectorMacro(SampleDimensions,int,3);
104 
106 
110  vtkSetVector6Macro(ModelBounds,double);
111  vtkGetVectorMacro(ModelBounds,double,6);
113 
115 
118  vtkSetClampMacro(Radius,double,0.0,1.0);
119  vtkGetMacro(Radius,double);
121 
123 
126  vtkSetClampMacro(ScaleFactor,double,0.0,VTK_DOUBLE_MAX);
127  vtkGetMacro(ScaleFactor,double);
129 
131 
133  vtkSetMacro(ExponentFactor,double);
134  vtkGetMacro(ExponentFactor,double);
136 
138 
141  vtkSetMacro(NormalWarping,int);
142  vtkGetMacro(NormalWarping,int);
143  vtkBooleanMacro(NormalWarping,int);
145 
147 
152  vtkSetClampMacro(Eccentricity,double,0.001,VTK_DOUBLE_MAX);
153  vtkGetMacro(Eccentricity,double);
155 
157 
158  vtkSetMacro(ScalarWarping,int);
159  vtkGetMacro(ScalarWarping,int);
160  vtkBooleanMacro(ScalarWarping,int);
162 
164 
167  vtkSetMacro(Capping,int);
168  vtkGetMacro(Capping,int);
169  vtkBooleanMacro(Capping,int);
171 
173 
175  vtkSetMacro(CapValue,double);
176  vtkGetMacro(CapValue,double);
178 
180 
184  vtkSetClampMacro(AccumulationMode,int,
186  vtkGetMacro(AccumulationMode,int);
188  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
190  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
192  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
193  const char *GetAccumulationModeAsString();
195 
197 
200  vtkSetMacro(NullValue,double);
201  vtkGetMacro(NullValue,double);
203 
205 
207  void ComputeModelBounds(vtkDataSet *input, vtkImageData *output,
208  vtkInformation *outInfo);
209  void ComputeModelBounds(vtkCompositeDataSet *input, vtkImageData *output,
210  vtkInformation *outInfo);
212 
213 protected:
216 
218  virtual int RequestInformation (vtkInformation *,
221  virtual int RequestData(vtkInformation *,
224  void Cap(vtkDoubleArray *s);
225 
226  int SampleDimensions[3]; // dimensions of volume to splat into
227  double Radius; // maximum distance splat propagates (as fraction 0->1)
228  double ExponentFactor; // scale exponent of gaussian function
229  double ModelBounds[6]; // bounding box of splatting dimensions
230  int NormalWarping; // on/off warping of splat via normal
231  double Eccentricity;// elliptic distortion due to normals
232  int ScalarWarping; // on/off warping of splat via scalar
233  double ScaleFactor; // splat size influenced by scale factor
234  int Capping; // Cap side of volume to close surfaces
235  double CapValue; // value to use for capping
236  int AccumulationMode; // how to combine scalar values
237 
238  double Gaussian(double x[3]);
239  double EccentricGaussian(double x[3]);
240  double ScalarSampling(double s)
241  {return this->ScaleFactor * s;}
242  double PositionSampling(double)
243  {return this->ScaleFactor;}
244  void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
245 
246 //BTX
247 private:
248  double Radius2;
249  double (vtkGaussianSplatter::*Sample)(double x[3]);
250  double (vtkGaussianSplatter::*SampleFactor)(double s);
251  char *Visited;
252  double Eccentricity2;
253  double *P;
254  double *N;
255  double S;
256  double Origin[3];
257  double Spacing[3];
258  double SplatDistance[3];
259  double NullValue;
260 //ETX
261 
262 private:
263  vtkGaussianSplatter(const vtkGaussianSplatter&); // Not implemented.
264  void operator=(const vtkGaussianSplatter&); // Not implemented.
265 };
266 
267 #endif
268 
269 
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
Store vtkAlgorithm input/output information.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
abstract class to specify dataset behavior
Definition: vtkDataSet.h:59
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
#define VTK_ACCUMULATION_MODE_MAX
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:133
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
splat points into a volume with an elliptical, Gaussian distribution
dynamic, self-adjusting array of double
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
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 vtkSetVector6Macro(name, type)
Definition: vtkSetGet.h:350
#define VTK_ACCUMULATION_MODE_MIN
GLdouble s
Definition: vtkgl.h:11594
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
#define VTKIMAGINGHYBRID_EXPORT
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:414
double ScalarSampling(double s)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69