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

graphics/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 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00057 #ifndef __vtkGaussianSplatter_h
00058 #define __vtkGaussianSplatter_h
00059 
00060 #include "vtkDataSetToStructuredPointsFilter.h"
00061 
00062 #define VTK_ACCUMULATION_MODE_MIN 0
00063 #define VTK_ACCUMULATION_MODE_MAX 1
00064 #define VTK_ACCUMULATION_MODE_SUM 2
00065 
00066 class VTK_EXPORT vtkGaussianSplatter : public vtkDataSetToStructuredPointsFilter 
00067 {
00068 public:
00069   vtkTypeMacro(vtkGaussianSplatter,vtkDataSetToStructuredPointsFilter);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00075   static vtkGaussianSplatter *New();
00076 
00079   void ComputeModelBounds();
00080 
00082   void SetSampleDimensions(int i, int j, int k);
00083   void SetSampleDimensions(int dim[3]);
00084   vtkGetVectorMacro(SampleDimensions,int,3);
00085 
00089   vtkSetClampMacro(Radius,float,0.0,1.0);
00090   vtkGetMacro(Radius,float);
00091 
00093   vtkSetClampMacro(ScaleFactor,float,0.0,VTK_LARGE_FLOAT);
00094   vtkGetMacro(ScaleFactor,float);
00095 
00097   vtkSetMacro(ExponentFactor,float);
00098   vtkGetMacro(ExponentFactor,float);
00099 
00103   vtkSetClampMacro(Eccentricity,float,0.001,VTK_LARGE_FLOAT);
00104   vtkGetMacro(Eccentricity,float);
00105 
00108   vtkSetVector6Macro(ModelBounds,float);
00109   vtkGetVectorMacro(ModelBounds,float,6);
00110 
00112   vtkSetMacro(NormalWarping,int);
00113   vtkGetMacro(NormalWarping,int);
00114   vtkBooleanMacro(NormalWarping,int);
00115 
00117   vtkSetMacro(ScalarWarping,int);
00118   vtkGetMacro(ScalarWarping,int);
00119   vtkBooleanMacro(ScalarWarping,int);
00120 
00123   vtkSetMacro(Capping,int);
00124   vtkGetMacro(Capping,int);
00125   vtkBooleanMacro(Capping,int);
00126   
00128   vtkSetMacro(CapValue,float);
00129   vtkGetMacro(CapValue,float);
00130 
00133   vtkSetClampMacro(AccumulationMode,int,
00134                    VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00135   vtkGetMacro(AccumulationMode,int);
00136   void SetAccumulationModeToMin()
00137     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00138   void SetAccumulationModeToMax()
00139     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00140   void SetAccumulationModeToSum()
00141     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00142   const char *GetAccumulationModeAsString();
00143 
00144 protected:
00145   vtkGaussianSplatter();
00146   ~vtkGaussianSplatter() {};
00147   vtkGaussianSplatter(const vtkGaussianSplatter&) {};
00148   void operator=(const vtkGaussianSplatter&) {};
00149 
00150   void Execute();
00151   void Cap(vtkScalars *s);
00152 
00153   int SampleDimensions[3]; // dimensions of volume to splat into
00154   float Radius; // maximum distance splat propagates (as fraction 0->1)
00155   float ExponentFactor; // scale exponent of gaussian function
00156   float ModelBounds[6]; // bounding box of splatting dimensions
00157   int NormalWarping; // on/off warping of splat via normal
00158   float Eccentricity;// elliptic distortion due to normals
00159   int ScalarWarping; // on/off warping of splat via scalar
00160   float ScaleFactor; // splat size influenced by scale factor
00161   int Capping; // Cap side of volume to close surfaces
00162   float CapValue; // value to use for capping
00163   int AccumulationMode; // how to combine scalar values
00164 
00165   // recursive propagation of splat
00166   void SplitIJK(int i, int idir, int j, int jdir, int k, int kdir);
00167   void SplitIJ(int i, int idir, int j, int jdir, int k);
00168   void SplitIK(int i, int idir, int j, int k, int kdir);
00169   void SplitJK(int i, int j, int jdir, int k, int kdir);
00170   void SplitI(int i, int idir, int j, int k);
00171   void SplitJ(int i, int j, int jdir, int k);
00172   void SplitK(int i, int j, int k, int kdir);
00173 
00174   float Gaussian(float x[3]);  
00175   float EccentricGaussian(float x[3]);  
00176   float ScalarSampling(float s) {return this->ScaleFactor * s;};
00177   float PositionSampling(float) {return this->ScaleFactor;};
00178   void SetScalar(int idx, float dist2);
00179 
00180 //BTX
00181 private:
00182   vtkScalars *NewScalars;
00183   float Radius2;
00184   float (vtkGaussianSplatter::*Sample)(float x[3]);
00185   float (vtkGaussianSplatter::*SampleFactor)(float s);
00186   char *Visited;
00187   float Eccentricity2;
00188   float *P;
00189   float *N;
00190   float S;
00191   float Origin[3];
00192   float Spacing[3];
00193 //ETX
00194 
00195 };
00196 
00197 #endif
00198 
00199 

Generated on Wed Nov 21 12:26:59 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001