vtkImageCurveRegion.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __vtkImageCurveRegion_h
00020 #define __vtkImageCurveRegion_h
00021
00022 #include "vtkImageSource.h"
00023 #include "vtkEMSegmentStep.h"
00024
00025
00026
00027
00028 #define COERCE(x, type) (*((type *)(&(x))))
00029
00030
00031 #define EMSEGMENT_MANTSIZE (23)
00032 #define EMSEGMENT_SIGNBIT (1 << 31)
00033 #define EMSEGMENT_EXPMASK (255 << EMSEGMENT_MANTSIZE)
00034 #define EMSEGMENT_MENTMASK ((~EMSEGMENT_EXPMASK)&(~EMSEGMENT_SIGNBIT))
00035 #define EMSEGMENT_PHANTOM_BIT (1 << EMSEGMENT_MANTSIZE)
00036 #define EMSEGMENT_EXPBIAS 127
00037 #define EMSEGMENT_SHIFTED_BIAS (EMSEGMENT_EXPBIAS << EMSEGMENT_MANTSIZE)
00038 #define EMSEGMENT_SHIFTED_BIAS_COMP ((~ EMSEGMENT_SHIFTED_BIAS) + 1)
00039 #define EMSEGMENT_ONE_OVER_2_PI 0.5/3.14159265358979
00040 #define EMSEGMENT_ONE_OVER_ROOT_2_PI sqrt(EMSEGMENT_ONE_OVER_2_PI)
00041 #define EMSEGMENT_MINUS_ONE_OVER_2_LOG_2 ((float) -.72134752)
00042
00043 class VTK_EMSEGMENT_EXPORT vtkImageCurveRegion : public vtkImageSource
00044 {
00045 public:
00046 static vtkImageCurveRegion *New();
00047 vtkTypeMacro(vtkImageCurveRegion,vtkImageSource);
00048 void PrintSelf(ostream& os, vtkIndent indent);
00049
00050 void SetDimension(int value);
00051 vtkGetMacro(Dimension, int);
00052 vtkSetMacro(Xmin, float);
00053 vtkGetMacro(Xmin, float);
00054 vtkSetMacro(Xmax, float);
00055 vtkGetMacro(Xmax, float);
00056
00057
00058 vtkSetMacro(Xunit, float);
00059 vtkGetMacro(Xunit, float);
00060 vtkSetMacro(Xlength, int);
00061 vtkGetMacro(Xlength, int);
00062
00063
00064 vtkSetMacro(Ymin, float);
00065 vtkGetMacro(Ymin, float);
00066 vtkSetMacro(Ymax, float);
00067 vtkGetMacro(Ymax, float);
00068
00069
00070 vtkSetMacro(Yunit, float);
00071 vtkGetMacro(Yunit, float);
00072
00073 vtkSetMacro(Ylength, int);
00074 vtkGetMacro(Ylength, int);
00075
00076
00077
00078 vtkGetMacro(FctMax, float);
00079 vtkGetMacro(FctMin, float);
00080
00081
00082
00083
00084
00085
00086
00087 void SetFunction(int val);
00088 vtkGetMacro(Function, int);
00089
00090
00091
00092
00093 void SetMean(float value, int x) { if (this->Mean[x] != value) {this->Mean[x] = value; this->Modified();}}
00094 float GetMean(int x) {return this->Mean[x];}
00095
00096 void SetCovariance(float value, int y, int x) {if (this->Covariance[y][x] != value) {this->Covariance[y][x] = value; this->Modified();}}
00097 float GetCovariance(int y, int x) {return this->Covariance[y][x];}
00098
00099
00100
00101 vtkSetMacro(Probability, float);
00102 vtkGetMacro(Probability, float);
00103
00104 vtkGetStringMacro(FileName);
00105 vtkSetStringMacro(FileName);
00106
00107 protected:
00108 vtkImageCurveRegion();
00109 void DeleteVariables();
00110 ~vtkImageCurveRegion() {this->DeleteVariables();};
00111
00112 int Dimension;
00113 int Function;
00114 float Xmin;
00115 float Xmax;
00116 float Xunit;
00117 int Xlength;
00118
00119 float Ymin;
00120 float Ymax;
00121 float Yunit;
00122 int Ylength;
00123
00124 float FctMax;
00125 float FctMin;
00126
00127 float* Mean;
00128 float** Covariance;
00129 float Probability;
00130
00131 char* FileName;
00132
00133 virtual void ExecuteInformation();
00134 virtual void ExecuteData(vtkDataObject *data);
00135 void ExecuteDataReadFile(vtkDataObject *output) ;
00136 void ExecuteDataGauss(vtkDataObject *output);
00137 private:
00138 vtkImageCurveRegion(const vtkImageCurveRegion&);
00139 void operator=(const vtkImageCurveRegion&);
00140 };
00141
00142
00143 #endif
00144
00145