vtkEncodedGradientEstimator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00044 #ifndef __vtkEncodedGradientEstimator_h
00045 #define __vtkEncodedGradientEstimator_h
00046
00047 #include "vtkObject.h"
00048
00049 class vtkImageData;
00050 class vtkDirectionEncoder;
00051 class vtkMultiThreader;
00052
00053 class VTK_RENDERING_EXPORT vtkEncodedGradientEstimator : public vtkObject
00054 {
00055 public:
00056 vtkTypeRevisionMacro(vtkEncodedGradientEstimator,vtkObject);
00057 void PrintSelf( ostream& os, vtkIndent indent );
00058
00060
00061 virtual void SetInput(vtkImageData*);
00062 vtkGetObjectMacro( Input, vtkImageData );
00064
00066
00067 vtkSetMacro( GradientMagnitudeScale, float );
00068 vtkGetMacro( GradientMagnitudeScale, float );
00069 vtkSetMacro( GradientMagnitudeBias, float );
00070 vtkGetMacro( GradientMagnitudeBias, float );
00072
00074
00076 vtkSetClampMacro( BoundsClip, int, 0, 1 );
00077 vtkGetMacro( BoundsClip, int );
00078 vtkBooleanMacro( BoundsClip, int );
00080
00082
00085 vtkSetVector6Macro( Bounds, int );
00086 vtkGetVectorMacro( Bounds, int, 6 );
00088
00090 void Update( void );
00091
00093 unsigned short *GetEncodedNormals( void );
00094
00096
00097 int GetEncodedNormalIndex( int xyz_index );
00098 int GetEncodedNormalIndex( int x_index, int y_index, int z_index );
00100
00102 unsigned char *GetGradientMagnitudes(void);
00103
00105
00107 vtkSetClampMacro( NumberOfThreads, int, 1, VTK_MAX_THREADS );
00108 vtkGetMacro( NumberOfThreads, int );
00110
00112
00114 void SetDirectionEncoder( vtkDirectionEncoder *direnc );
00115 vtkGetObjectMacro( DirectionEncoder, vtkDirectionEncoder );
00117
00119
00123 vtkSetMacro( ComputeGradientMagnitudes, int );
00124 vtkGetMacro( ComputeGradientMagnitudes, int );
00125 vtkBooleanMacro( ComputeGradientMagnitudes, int );
00127
00129
00133 vtkSetMacro( CylinderClip, int );
00134 vtkGetMacro( CylinderClip, int );
00135 vtkBooleanMacro( CylinderClip, int );
00137
00139
00140 vtkGetMacro( LastUpdateTimeInSeconds, float );
00141 vtkGetMacro( LastUpdateTimeInCPUSeconds, float );
00143
00144 vtkGetMacro( UseCylinderClip, int );
00145 int *GetCircleLimits() { return this->CircleLimits; };
00146
00148
00154 void SetZeroNormalThreshold( float v );
00155 vtkGetMacro( ZeroNormalThreshold, float );
00157
00159
00161 vtkSetClampMacro( ZeroPad, int, 0, 1 );
00162 vtkGetMacro( ZeroPad, int );
00163 vtkBooleanMacro( ZeroPad, int );
00165
00166
00167
00168
00169
00170
00171
00172
00173 vtkImageData *Input;
00174
00175
00176 unsigned short *EncodedNormals;
00177 int EncodedNormalsSize[3];
00178
00179
00180 unsigned char *GradientMagnitudes;
00181
00182
00183 vtkTimeStamp BuildTime;
00184
00185
00186 vtkGetVectorMacro( InputSize, int, 3 );
00187 vtkGetVectorMacro( InputAspect, float, 3 );
00188
00189
00190 protected:
00191 vtkEncodedGradientEstimator();
00192 ~vtkEncodedGradientEstimator();
00193
00194 virtual void ReportReferences(vtkGarbageCollector*);
00195 virtual void RemoveReferences();
00196
00197
00198 int NumberOfThreads;
00199
00200 vtkMultiThreader *Threader;
00201
00202 vtkDirectionEncoder *DirectionEncoder;
00203
00204 virtual void UpdateNormals( void ) = 0;
00205
00206 float GradientMagnitudeScale;
00207 float GradientMagnitudeBias;
00208
00209 float LastUpdateTimeInSeconds;
00210 float LastUpdateTimeInCPUSeconds;
00211
00212 float ZeroNormalThreshold;
00213
00214 int CylinderClip;
00215 int *CircleLimits;
00216 int CircleLimitsSize;
00217 int UseCylinderClip;
00218 void ComputeCircleLimits( int size );
00219
00220 int BoundsClip;
00221 int Bounds[6];
00222
00223 int InputSize[3];
00224 float InputAspect[3];
00225
00226 int ComputeGradientMagnitudes;
00227
00228 int ZeroPad;
00229
00230 private:
00231 vtkEncodedGradientEstimator(const vtkEncodedGradientEstimator&);
00232 void operator=(const vtkEncodedGradientEstimator&);
00233 };
00234
00235
00236 #endif
00237