VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
84 
86 {
87 public:
89  void PrintSelf(ostream& os, vtkIndent indent);
90 
94  static vtkGaussianSplatter *New();
95 
97 
99  void SetSampleDimensions(int i, int j, int k);
100  void SetSampleDimensions(int dim[3]);
101  vtkGetVectorMacro(SampleDimensions,int,3);
103 
105 
109  vtkSetVector6Macro(ModelBounds,double);
110  vtkGetVectorMacro(ModelBounds,double,6);
112 
114 
117  vtkSetClampMacro(Radius,double,0.0,1.0);
118  vtkGetMacro(Radius,double);
120 
122 
125  vtkSetClampMacro(ScaleFactor,double,0.0,VTK_DOUBLE_MAX);
126  vtkGetMacro(ScaleFactor,double);
128 
130 
132  vtkSetMacro(ExponentFactor,double);
133  vtkGetMacro(ExponentFactor,double);
135 
137 
140  vtkSetMacro(NormalWarping,int);
141  vtkGetMacro(NormalWarping,int);
142  vtkBooleanMacro(NormalWarping,int);
144 
146 
151  vtkSetClampMacro(Eccentricity,double,0.001,VTK_DOUBLE_MAX);
152  vtkGetMacro(Eccentricity,double);
154 
156 
157  vtkSetMacro(ScalarWarping,int);
158  vtkGetMacro(ScalarWarping,int);
159  vtkBooleanMacro(ScalarWarping,int);
161 
163 
166  vtkSetMacro(Capping,int);
167  vtkGetMacro(Capping,int);
168  vtkBooleanMacro(Capping,int);
170 
172 
174  vtkSetMacro(CapValue,double);
175  vtkGetMacro(CapValue,double);
177 
179 
183  vtkSetClampMacro(AccumulationMode,int,
185  vtkGetMacro(AccumulationMode,int);
187  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
189  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
191  {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
192  const char *GetAccumulationModeAsString();
194 
196 
199  vtkSetMacro(NullValue,double);
200  vtkGetMacro(NullValue,double);
202 
204 
206  void ComputeModelBounds(vtkDataSet *input, vtkImageData *output,
207  vtkInformation *outInfo);
209 
210 protected:
213 
215  virtual int RequestInformation (vtkInformation *,
218  virtual int RequestData(vtkInformation *,
221  void Cap(vtkDoubleArray *s);
222 
223  int SampleDimensions[3]; // dimensions of volume to splat into
224  double Radius; // maximum distance splat propagates (as fraction 0->1)
225  double ExponentFactor; // scale exponent of gaussian function
226  double ModelBounds[6]; // bounding box of splatting dimensions
227  int NormalWarping; // on/off warping of splat via normal
228  double Eccentricity;// elliptic distortion due to normals
229  int ScalarWarping; // on/off warping of splat via scalar
230  double ScaleFactor; // splat size influenced by scale factor
231  int Capping; // Cap side of volume to close surfaces
232  double CapValue; // value to use for capping
233  int AccumulationMode; // how to combine scalar values
234 
235  double Gaussian(double x[3]);
236  double EccentricGaussian(double x[3]);
237  double ScalarSampling(double s)
238  {return this->ScaleFactor * s;}
239  double PositionSampling(double)
240  {return this->ScaleFactor;}
241  void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
242 
243 //BTX
244 private:
245  double Radius2;
246  double (vtkGaussianSplatter::*Sample)(double x[3]);
247  double (vtkGaussianSplatter::*SampleFactor)(double s);
248  char *Visited;
249  double Eccentricity2;
250  double *P;
251  double *N;
252  double S;
253  double Origin[3];
254  double Spacing[3];
255  double SplatDistance[3];
256  double NullValue;
257 //ETX
258 
259 private:
260  vtkGaussianSplatter(const vtkGaussianSplatter&); // Not implemented.
261  void operator=(const vtkGaussianSplatter&); // Not implemented.
262 };
263 
264 #endif
265 
266 
#define VTK_DOUBLE_MAX
Definition: vtkType.h:141
Store vtkAlgorithm input/output information.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
#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:619
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
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