Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Imaging/vtkGaussianSplatter.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkGaussianSplatter.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00089 #ifndef __vtkGaussianSplatter_h
    00090 #define __vtkGaussianSplatter_h
    00091
    00092 #include "vtkDataSetToImageFilter.h"
    00093
    00094 #define VTK_ACCUMULATION_MODE_MIN 0
    00095 #define VTK_ACCUMULATION_MODE_MAX 1
    00096 #define VTK_ACCUMULATION_MODE_SUM 2
    00097
    00098 class vtkFloatArray;
    00099
    00100 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToImageFilter
    00101 {
    00102 public:
    00103   vtkTypeRevisionMacro(vtkGaussianSplatter,vtkDataSetToImageFilter);
    00104   void PrintSelf(ostream& os, vtkIndent indent);
    00105
    00109   static vtkGaussianSplatter *New();
    00110
    00112
    00114   void SetSampleDimensions(int i, int j, int k);
    00115   void SetSampleDimensions(int dim[3]);
    00116   vtkGetVectorMacro(SampleDimensions,int,3);
    00118
    00120
    00124   vtkSetVector6Macro(ModelBounds,float);
    00125   vtkGetVectorMacro(ModelBounds,float,6);
    00127
    00129
    00132   vtkSetClampMacro(Radius,float,0.0,1.0);
    00133   vtkGetMacro(Radius,float);
    00135
    00137
    00140   vtkSetClampMacro(ScaleFactor,float,0.0,VTK_LARGE_FLOAT);
    00141   vtkGetMacro(ScaleFactor,float);
    00143
    00145
    00147   vtkSetMacro(ExponentFactor,float);
    00148   vtkGetMacro(ExponentFactor,float);
    00150
    00152
    00155   vtkSetMacro(NormalWarping,int);
    00156   vtkGetMacro(NormalWarping,int);
    00157   vtkBooleanMacro(NormalWarping,int);
    00159
    00161
    00166   vtkSetClampMacro(Eccentricity,float,0.001,VTK_LARGE_FLOAT);
    00167   vtkGetMacro(Eccentricity,float);
    00169
    00171
    00172   vtkSetMacro(ScalarWarping,int);
    00173   vtkGetMacro(ScalarWarping,int);
    00174   vtkBooleanMacro(ScalarWarping,int);
    00176
    00178
    00181   vtkSetMacro(Capping,int);
    00182   vtkGetMacro(Capping,int);
    00183   vtkBooleanMacro(Capping,int);
    00185
    00187
    00189   vtkSetMacro(CapValue,float);
    00190   vtkGetMacro(CapValue,float);
    00192
    00194
    00198   vtkSetClampMacro(AccumulationMode,int,
    00199                    VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
    00200   vtkGetMacro(AccumulationMode,int);
    00201   void SetAccumulationModeToMin()
    00202     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
    00203   void SetAccumulationModeToMax()
    00204     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
    00205   void SetAccumulationModeToSum()
    00206     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
    00207   const char *GetAccumulationModeAsString();
    00209
    00211
    00214   vtkSetMacro(NullValue,float);
    00215   vtkGetMacro(NullValue,float);
    00217
    00220   void ComputeModelBounds();
    00221
    00222 protected:
    00223   vtkGaussianSplatter();
    00224   ~vtkGaussianSplatter() {};
    00225
    00226   virtual void ExecuteInformation();
    00227   virtual void ExecuteData(vtkDataObject *);
    00228   void Cap(vtkFloatArray *s);
    00229
    00230   int SampleDimensions[3]; // dimensions of volume to splat into
    00231   float Radius; // maximum distance splat propagates (as fraction 0->1)
    00232   float ExponentFactor; // scale exponent of gaussian function
    00233   float ModelBounds[6]; // bounding box of splatting dimensions
    00234   int NormalWarping; // on/off warping of splat via normal
    00235   float Eccentricity;// elliptic distortion due to normals
    00236   int ScalarWarping; // on/off warping of splat via scalar
    00237   float ScaleFactor; // splat size influenced by scale factor
    00238   int Capping; // Cap side of volume to close surfaces
    00239   float CapValue; // value to use for capping
    00240   int AccumulationMode; // how to combine scalar values
    00241
    00242   float Gaussian(float x[3]);
    00243   float EccentricGaussian(float x[3]);
    00244   float ScalarSampling(float s)
    00245     {return this->ScaleFactor * s;}
    00246   float PositionSampling(float)
    00247     {return this->ScaleFactor;}
    00248   void SetScalar(int idx, float dist2, vtkFloatArray *newScalars);
    00249
    00250 //BTX
    00251 private:
    00252   float Radius2;
    00253   float (vtkGaussianSplatter::*Sample)(float x[3]);
    00254   float (vtkGaussianSplatter::*SampleFactor)(float s);
    00255   char *Visited;
    00256   float Eccentricity2;
    00257   float *P;
    00258   float *N;
    00259   float S;
    00260   float Origin[3];
    00261   float Spacing[3];
    00262   float SplatDistance[3];
    00263   float NullValue;
    00264 //ETX
    00265
    00266 private:
    00267   vtkGaussianSplatter(const vtkGaussianSplatter&);  // Not implemented.
    00268   void operator=(const vtkGaussianSplatter&);  // Not implemented.
    00269 };
    00270
    00271 #endif
    00272
    00273