00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00027 #ifndef __vtkImageMathematics_h
00028 #define __vtkImageMathematics_h
00029
00030
00031
00032 #define VTK_ADD 0
00033 #define VTK_SUBTRACT 1
00034 #define VTK_MULTIPLY 2
00035 #define VTK_DIVIDE 3
00036 #define VTK_INVERT 4
00037 #define VTK_SIN 5
00038 #define VTK_COS 6
00039 #define VTK_EXP 7
00040 #define VTK_LOG 8
00041 #define VTK_ABS 9
00042 #define VTK_SQR 10
00043 #define VTK_SQRT 11
00044 #define VTK_MIN 12
00045 #define VTK_MAX 13
00046 #define VTK_ATAN 14
00047 #define VTK_ATAN2 15
00048 #define VTK_MULTIPLYBYK 16
00049 #define VTK_ADDC 17
00050 #define VTK_CONJUGATE 18
00051 #define VTK_COMPLEX_MULTIPLY 19
00052 #define VTK_REPLACECBYK 20
00053
00054 #include "vtkThreadedImageAlgorithm.h"
00055
00056 class VTK_IMAGING_EXPORT vtkImageMathematics : public vtkThreadedImageAlgorithm
00057 {
00058 public:
00059 static vtkImageMathematics *New();
00060 vtkTypeMacro(vtkImageMathematics,vtkThreadedImageAlgorithm);
00061 void PrintSelf(ostream& os, vtkIndent indent);
00062
00064
00065 vtkSetMacro(Operation,int);
00066 vtkGetMacro(Operation,int);
00068
00071 void SetOperationToAdd() {this->SetOperation(VTK_ADD);};
00072
00075 void SetOperationToSubtract() {this->SetOperation(VTK_SUBTRACT);};
00076
00079 void SetOperationToMultiply() {this->SetOperation(VTK_MULTIPLY);};
00080
00083 void SetOperationToDivide() {this->SetOperation(VTK_DIVIDE);};
00084
00085 void SetOperationToConjugate() {this->SetOperation(VTK_CONJUGATE);};
00086
00087 void SetOperationToComplexMultiply()
00088 {this->SetOperation(VTK_COMPLEX_MULTIPLY);};
00089
00092 void SetOperationToInvert() {this->SetOperation(VTK_INVERT);};
00093
00096 void SetOperationToSin() {this->SetOperation(VTK_SIN);};
00097
00100 void SetOperationToCos() {this->SetOperation(VTK_COS);};
00101
00104 void SetOperationToExp() {this->SetOperation(VTK_EXP);};
00105
00108 void SetOperationToLog() {this->SetOperation(VTK_LOG);};
00109
00112 void SetOperationToAbsoluteValue() {this->SetOperation(VTK_ABS);};
00113
00116 void SetOperationToSquare() {this->SetOperation(VTK_SQR);};
00117
00120 void SetOperationToSquareRoot() {this->SetOperation(VTK_SQRT);};
00121
00125 void SetOperationToMin() {this->SetOperation(VTK_MIN);};
00126
00130 void SetOperationToMax() {this->SetOperation(VTK_MAX);};
00131
00134 void SetOperationToATAN() {this->SetOperation(VTK_ATAN);};
00135
00136 void SetOperationToATAN2() {this->SetOperation(VTK_ATAN2);};
00137
00140 void SetOperationToMultiplyByK() {this->SetOperation(VTK_MULTIPLYBYK);};
00141
00144 void SetOperationToAddConstant() {this->SetOperation(VTK_ADDC);};
00145
00148 void SetOperationToReplaceCByK() {this->SetOperation(VTK_REPLACECBYK);};
00149
00151
00153 vtkSetMacro(ConstantK,double);
00154 vtkGetMacro(ConstantK,double);
00156
00158
00160 vtkSetMacro(ConstantC,double);
00161 vtkGetMacro(ConstantC,double);
00163
00165
00166 vtkSetMacro(DivideByZeroToC,int);
00167 vtkGetMacro(DivideByZeroToC,int);
00168 vtkBooleanMacro(DivideByZeroToC,int);
00170
00172
00174 virtual void SetInput1(vtkDataObject *in) { this->SetInput(0,in); }
00175 virtual void SetInput2(vtkDataObject *in) { this->SetInput(1,in); }
00177
00178 protected:
00179 vtkImageMathematics();
00180 ~vtkImageMathematics() {};
00181
00182 int Operation;
00183 double ConstantK;
00184 double ConstantC;
00185 int DivideByZeroToC;
00186
00187 virtual int RequestInformation (vtkInformation *,
00188 vtkInformationVector **,
00189 vtkInformationVector *);
00190
00191 virtual void ThreadedRequestData(vtkInformation *request,
00192 vtkInformationVector **inputVector,
00193 vtkInformationVector *outputVector,
00194 vtkImageData ***inData,
00195 vtkImageData **outData,
00196 int extent[6], int threadId);
00197
00198 virtual int FillInputPortInformation(int port, vtkInformation* info);
00199
00200 private:
00201 vtkImageMathematics(const vtkImageMathematics&);
00202 void operator=(const vtkImageMathematics&);
00203 };
00204
00205 #endif
00206