00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkEncodedGradientEstimator_h
00012 #define __mitkEncodedGradientEstimator_h
00013
00014 #include "mitkObject.h"
00015 #include "mitkRCPtr.h"
00016 #include "mitkVolume.h"
00017 #include "mitkDirectionEncoder.h"
00018
00024 class MITK_VISUALIZATION_API mitkEncodedGradientEstimator : public mitkObject
00025 {
00026 public:
00027
00028 MITK_TYPE(mitkEncodedGradientEstimator,mitkObject)
00029
00030
00031
00032
00033
00034
00035 void SetInput(mitkVolume *pInVolume);
00036
00042 mitkVolume* GetInput(){return this->m_Input;}
00043
00048 void SetGradientMagnitudeScale(float fGMS){this->m_GradientMagnitudeScale = fGMS;};
00049
00054 float GetGradientMagnitudeScale(){return this->m_GradientMagnitudeScale;};
00055
00060 void SetGradientMagnitudeBias(float fGMB){this->m_GradientMagnitudeBias = fGMB;};
00061
00066 float GetGradientMagnitudeBias(){return this->m_GradientMagnitudeBias;};
00067
00073 virtual void SetBoundsClip(int nBoundsClip){
00074 if (this->m_BoundsClip != (nBoundsClip < 0 ? 0 : (nBoundsClip > 1 ? 1 : nBoundsClip)))
00075 {
00076 this->m_BoundsClip = (nBoundsClip < 0 ? 0 : (nBoundsClip > 1 ? 1 : nBoundsClip));
00077 }
00078 };
00079
00084 virtual int GetBoundsClipMinValue(){return 0;};
00085
00090 virtual int GetBoundsClipMaxValue(){return 1;};
00091
00096 virtual int GetBoundsClip(){return this->m_BoundsClip;};
00097
00101 virtual void SetBoundsClipOn(){this->SetBoundsClip(1);};
00102
00106 virtual void SetBoundsClipOff(){this->SetBoundsClip(0);};
00107
00118 virtual void SetBounds(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6);
00119
00130 virtual void SetBounds(int arg[6]);
00131
00142 virtual void GetBounds(int &arg1, int &arg2, int &arg3, int &arg4, int &arg5, int &arg6);
00143
00154 void GetBounds(int arg[6]);
00155
00161 int* GetBounds();
00162
00170 void SetComputeGradientMagnitudes(int nCGM){this->m_ComputeGradientMagnitudes = nCGM;};
00171
00176 int GetComputeGradientMagnitudes(){return this->m_ComputeGradientMagnitudes;};
00177
00183 virtual void SetComputeGradientMagnitudesOn(){this->SetComputeGradientMagnitudes(1);};
00184
00190 virtual void SetComputeGradientMagnitudesOff(){this->SetComputeGradientMagnitudes(0);};
00191
00198 void SetCylinderClip(int nCC){this->m_CylinderClip = nCC;};
00199
00204 int GetCylinderClip(){return this->m_CylinderClip;};
00205
00211 virtual void SetCylinderClipOn(){this->SetCylinderClip(1);};
00212
00218 virtual void SetCylinderClipOff(){this->SetCylinderClip(0);};
00219
00224 int GetUseCylinderClip(){return this->m_UseCylinderClip;};
00225
00230 int *GetCircleLimits() { return this->m_CircleLimits; };
00231
00241 void SetZeroNormalThreshold( float v );
00242
00247 float GetZeroNormalThreshold(){return this->m_ZeroNormalThreshold; };
00248
00254 virtual void SetZeroPad(int nZeroPad){
00255 if (this->m_ZeroPad != (nZeroPad < 0 ? 0 : (nZeroPad > 1 ? 1 : nZeroPad)))
00256 {
00257 this->m_ZeroPad = (nZeroPad < 0 ? 0 : (nZeroPad > 1 ? 1 : nZeroPad));
00258 }
00259 };
00260
00265 virtual int GetZeroPadMinValue(){return 0;};
00266
00271 virtual int GetZeroPadMaxValue(){return 1;};
00272
00277 virtual int GetZeroPad(){return this->m_ZeroPad;};
00278
00282 virtual void SetZeroPadOn(){this->SetZeroPad(1);};
00283
00287 virtual void SetZeroPadOff(){this->SetZeroPad(0);};
00288
00292 void Update();
00293
00303 unsigned short *GetEncodedNormals();
00304
00309 mitkVolume* GetEncodedNormalsVol();
00310
00311
00312 int GetEncodedNormalIndex( int xyz_index );
00313
00314
00315 int GetEncodedNormalIndex( int x_index, int y_index, int z_index );
00316
00326 unsigned char *GetGradientMagnitudes();
00327
00332 mitkVolume* GetGradientMagnitudesVol();
00333
00339 void SetDirectionEncoder( mitkDirectionEncoder *direnc );
00340
00346 mitkDirectionEncoder* GetDirectionEncoder(){return this->m_DirectionEncoder;}
00347
00348
00349
00350
00351
00352
00353
00354
00355 mitkRCPtr<mitkVolume> m_Input;
00356
00357
00358 unsigned short *m_EncodedNormals;
00359 int m_EncodedNormalsSize[3];
00360
00361
00362 unsigned char *m_GradientMagnitudes;
00363
00364
00365 mitkVolume *m_EncodedNormalsVol;
00366 mitkVolume *m_GradientMagnitudesVol;
00367
00368 int *GetInputSize(){return this->m_InputSize;};
00369 void GetInputSize(int data[3]){for (int i = 0; i < 3; i++) data[i] = this->m_InputSize[i];};
00370 float *GetInputAspect(){return this->m_InputAspect;};
00371 void GetInputAspect(float data[3]){for (int i = 0; i < 3; i++) data[i] = this->m_InputAspect[i];};
00372
00373
00374 protected:
00375 mitkEncodedGradientEstimator();
00376 virtual ~mitkEncodedGradientEstimator();
00377
00378
00379
00380 mitkRCPtr<mitkDirectionEncoder> m_DirectionEncoder;
00381
00382 float m_GradientMagnitudeScale;
00383 float m_GradientMagnitudeBias;
00384
00385 float m_ZeroNormalThreshold;
00386
00387 int m_CylinderClip;
00388 int *m_CircleLimits;
00389 int m_CircleLimitsSize;
00390 int m_UseCylinderClip;
00391
00392 int m_BoundsClip;
00393 int m_Bounds[6];
00394
00395 int m_InputSize[3];
00396 float m_InputAspect[3];
00397
00398 int m_ComputeGradientMagnitudes;
00399
00400 int m_ZeroPad;
00401
00402 bool m_EnalbleOoC;
00403
00404 virtual void _updateNormals( void ) = 0;
00405 void _computeCircleLimits( int size );
00406
00407 private:
00408 mitkEncodedGradientEstimator(const mitkEncodedGradientEstimator&);
00409 void operator=(const mitkEncodedGradientEstimator&);
00410 };
00411
00412
00413
00414
00415
00416
00417 #endif
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460