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 
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 =========================================================================*/
00101 #ifndef __vtkGaussianSplatter_h
00102 #define __vtkGaussianSplatter_h
00103 
00104 #include "vtkDataSetToStructuredPointsFilter.h"
00105 
00106 #define VTK_ACCUMULATION_MODE_MIN 0
00107 #define VTK_ACCUMULATION_MODE_MAX 1
00108 #define VTK_ACCUMULATION_MODE_SUM 2
00109 
00110 class vtkFloatAray;
00111 
00112 class VTK_IMAGING_EXPORT vtkGaussianSplatter : public vtkDataSetToStructuredPointsFilter 
00113 {
00114 public:
00115   vtkTypeMacro(vtkGaussianSplatter,vtkDataSetToStructuredPointsFilter);
00116   void PrintSelf(ostream& os, vtkIndent indent);
00117 
00121   static vtkGaussianSplatter *New();
00122 
00124 
00126   void SetSampleDimensions(int i, int j, int k);
00127   void SetSampleDimensions(int dim[3]);
00128   vtkGetVectorMacro(SampleDimensions,int,3);
00130 
00132 
00136   vtkSetVector6Macro(ModelBounds,float);
00137   vtkGetVectorMacro(ModelBounds,float,6);
00139 
00141 
00144   vtkSetClampMacro(Radius,float,0.0,1.0);
00145   vtkGetMacro(Radius,float);
00147 
00149 
00152   vtkSetClampMacro(ScaleFactor,float,0.0,VTK_LARGE_FLOAT);
00153   vtkGetMacro(ScaleFactor,float);
00155 
00157 
00159   vtkSetMacro(ExponentFactor,float);
00160   vtkGetMacro(ExponentFactor,float);
00162 
00164 
00167   vtkSetMacro(NormalWarping,int);
00168   vtkGetMacro(NormalWarping,int);
00169   vtkBooleanMacro(NormalWarping,int);
00171 
00173 
00178   vtkSetClampMacro(Eccentricity,float,0.001,VTK_LARGE_FLOAT);
00179   vtkGetMacro(Eccentricity,float);
00181 
00183 
00184   vtkSetMacro(ScalarWarping,int);
00185   vtkGetMacro(ScalarWarping,int);
00186   vtkBooleanMacro(ScalarWarping,int);
00188 
00190 
00193   vtkSetMacro(Capping,int);
00194   vtkGetMacro(Capping,int);
00195   vtkBooleanMacro(Capping,int);
00197   
00199 
00201   vtkSetMacro(CapValue,float);
00202   vtkGetMacro(CapValue,float);
00204 
00206 
00210   vtkSetClampMacro(AccumulationMode,int,
00211                    VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
00212   vtkGetMacro(AccumulationMode,int);
00213   void SetAccumulationModeToMin()
00214     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
00215   void SetAccumulationModeToMax()
00216     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
00217   void SetAccumulationModeToSum()
00218     {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
00219   const char *GetAccumulationModeAsString();
00221 
00223 
00226   vtkSetMacro(NullValue,float);
00227   vtkGetMacro(NullValue,float);
00229 
00232   void ComputeModelBounds();
00233 
00234 protected:
00235   vtkGaussianSplatter();
00236   ~vtkGaussianSplatter() {};
00237 
00238   void Execute();
00239   void Cap(vtkFloatArray *s);
00240 
00241   int SampleDimensions[3]; // dimensions of volume to splat into
00242   float Radius; // maximum distance splat propagates (as fraction 0->1)
00243   float ExponentFactor; // scale exponent of gaussian function
00244   float ModelBounds[6]; // bounding box of splatting dimensions
00245   int NormalWarping; // on/off warping of splat via normal
00246   float Eccentricity;// elliptic distortion due to normals
00247   int ScalarWarping; // on/off warping of splat via scalar
00248   float ScaleFactor; // splat size influenced by scale factor
00249   int Capping; // Cap side of volume to close surfaces
00250   float CapValue; // value to use for capping
00251   int AccumulationMode; // how to combine scalar values
00252 
00253   float Gaussian(float x[3]);  
00254   float EccentricGaussian(float x[3]);  
00255   float ScalarSampling(float s) 
00256     {return this->ScaleFactor * s;}
00257   float PositionSampling(float) 
00258     {return this->ScaleFactor;}
00259   void SetScalar(int idx, float dist2);
00260 
00261 //BTX
00262 private:
00263   vtkFloatArray *NewScalars;
00264   float Radius2;
00265   float (vtkGaussianSplatter::*Sample)(float x[3]);
00266   float (vtkGaussianSplatter::*SampleFactor)(float s);
00267   char *Visited;
00268   float Eccentricity2;
00269   float *P;
00270   float *N;
00271   float S;
00272   float Origin[3];
00273   float Spacing[3];
00274   float SplatDistance[3];
00275   float NullValue;
00276 //ETX
00277 
00278 private:
00279   vtkGaussianSplatter(const vtkGaussianSplatter&);  // Not implemented.
00280   void operator=(const vtkGaussianSplatter&);  // Not implemented.
00281 };
00282 
00283 #endif
00284 
00285 

Generated on Thu Mar 28 14:19:24 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001