00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00033 #ifndef __vtkEncodedGradientEstimator_h
00034 #define __vtkEncodedGradientEstimator_h
00035
00036 #include "vtkObject.h"
00037
00038 class vtkImageData;
00039 class vtkDirectionEncoder;
00040 class vtkMultiThreader;
00041
00042 class VTK_VOLUMERENDERING_EXPORT vtkEncodedGradientEstimator : public vtkObject
00043 {
00044 public:
00045 vtkTypeRevisionMacro(vtkEncodedGradientEstimator,vtkObject);
00046 void PrintSelf( ostream& os, vtkIndent indent );
00047
00049
00050 virtual void SetInput(vtkImageData*);
00051 vtkGetObjectMacro( Input, vtkImageData );
00053
00055
00056 vtkSetMacro( GradientMagnitudeScale, float );
00057 vtkGetMacro( GradientMagnitudeScale, float );
00058 vtkSetMacro( GradientMagnitudeBias, float );
00059 vtkGetMacro( GradientMagnitudeBias, float );
00061
00063
00065 vtkSetClampMacro( BoundsClip, int, 0, 1 );
00066 vtkGetMacro( BoundsClip, int );
00067 vtkBooleanMacro( BoundsClip, int );
00069
00071
00074 vtkSetVector6Macro( Bounds, int );
00075 vtkGetVectorMacro( Bounds, int, 6 );
00077
00079 void Update( void );
00080
00082 unsigned short *GetEncodedNormals( void );
00083
00085
00086 int GetEncodedNormalIndex( int xyz_index );
00087 int GetEncodedNormalIndex( int x_index, int y_index, int z_index );
00089
00091 unsigned char *GetGradientMagnitudes(void);
00092
00094
00096 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00097 vtkGetMacro( NumberOfThreads, int );
00099
00101
00103 void SetDirectionEncoder( vtkDirectionEncoder *direnc );
00104 vtkGetObjectMacro( DirectionEncoder, vtkDirectionEncoder );
00106
00108
00112 vtkSetMacro( ComputeGradientMagnitudes, int );
00113 vtkGetMacro( ComputeGradientMagnitudes, int );
00114 vtkBooleanMacro( ComputeGradientMagnitudes, int );
00116
00118
00122 vtkSetMacro( CylinderClip, int );
00123 vtkGetMacro( CylinderClip, int );
00124 vtkBooleanMacro( CylinderClip, int );
00126
00128
00129 vtkGetMacro( LastUpdateTimeInSeconds, float );
00130 vtkGetMacro( LastUpdateTimeInCPUSeconds, float );
00132
00133 vtkGetMacro( UseCylinderClip, int );
00134 int *GetCircleLimits() { return this->CircleLimits; };
00135
00137
00143 void SetZeroNormalThreshold( float v );
00144 vtkGetMacro( ZeroNormalThreshold, float );
00146
00148
00150 vtkSetClampMacro( ZeroPad, int, 0, 1 );
00151 vtkGetMacro( ZeroPad, int );
00152 vtkBooleanMacro( ZeroPad, int );
00154
00155
00156
00157
00158
00159
00160
00161
00162 vtkImageData *Input;
00163
00164
00165 unsigned short *EncodedNormals;
00166 int EncodedNormalsSize[3];
00167
00168
00169 unsigned char *GradientMagnitudes;
00170
00171
00172 vtkTimeStamp BuildTime;
00173
00174
00175 vtkGetVectorMacro( InputSize, int, 3 );
00176 vtkGetVectorMacro( InputAspect, float, 3 );
00177
00178
00179 protected:
00180 vtkEncodedGradientEstimator();
00181 ~vtkEncodedGradientEstimator();
00182
00183 virtual void ReportReferences(vtkGarbageCollector*);
00184
00185
00186 int NumberOfThreads;
00187
00188 vtkMultiThreader *Threader;
00189
00190 vtkDirectionEncoder *DirectionEncoder;
00191
00192 virtual void UpdateNormals( void ) = 0;
00193
00194 float GradientMagnitudeScale;
00195 float GradientMagnitudeBias;
00196
00197 float LastUpdateTimeInSeconds;
00198 float LastUpdateTimeInCPUSeconds;
00199
00200 float ZeroNormalThreshold;
00201
00202 int CylinderClip;
00203 int *CircleLimits;
00204 int CircleLimitsSize;
00205 int UseCylinderClip;
00206 void ComputeCircleLimits( int size );
00207
00208 int BoundsClip;
00209 int Bounds[6];
00210
00211 int InputSize[3];
00212 float InputAspect[3];
00213
00214 int ComputeGradientMagnitudes;
00215
00216 int ZeroPad;
00217
00218 private:
00219 vtkEncodedGradientEstimator(const vtkEncodedGradientEstimator&);
00220 void operator=(const vtkEncodedGradientEstimator&);
00221 };
00222
00223
00224 #endif
00225