VTK
vtkImageMathematics.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageMathematics.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef __vtkImageMathematics_h
28 #define __vtkImageMathematics_h
29 
30 
31 // Operation options.
32 #define VTK_ADD 0
33 #define VTK_SUBTRACT 1
34 #define VTK_MULTIPLY 2
35 #define VTK_DIVIDE 3
36 #define VTK_INVERT 4
37 #define VTK_SIN 5
38 #define VTK_COS 6
39 #define VTK_EXP 7
40 #define VTK_LOG 8
41 #define VTK_ABS 9
42 #define VTK_SQR 10
43 #define VTK_SQRT 11
44 #define VTK_MIN 12
45 #define VTK_MAX 13
46 #define VTK_ATAN 14
47 #define VTK_ATAN2 15
48 #define VTK_MULTIPLYBYK 16
49 #define VTK_ADDC 17
50 #define VTK_CONJUGATE 18
51 #define VTK_COMPLEX_MULTIPLY 19
52 #define VTK_REPLACECBYK 20
53 
55 
57 {
58 public:
59  static vtkImageMathematics *New();
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
65  vtkSetMacro(Operation,int);
66  vtkGetMacro(Operation,int);
68 
71  void SetOperationToAdd() {this->SetOperation(VTK_ADD);};
72 
75  void SetOperationToSubtract() {this->SetOperation(VTK_SUBTRACT);};
76 
79  void SetOperationToMultiply() {this->SetOperation(VTK_MULTIPLY);};
80 
83  void SetOperationToDivide() {this->SetOperation(VTK_DIVIDE);};
84 
85  void SetOperationToConjugate() {this->SetOperation(VTK_CONJUGATE);};
86 
87  void SetOperationToComplexMultiply()
88  {this->SetOperation(VTK_COMPLEX_MULTIPLY);};
89 
92  void SetOperationToInvert() {this->SetOperation(VTK_INVERT);};
93 
96  void SetOperationToSin() {this->SetOperation(VTK_SIN);};
97 
100  void SetOperationToCos() {this->SetOperation(VTK_COS);};
101 
104  void SetOperationToExp() {this->SetOperation(VTK_EXP);};
105 
108  void SetOperationToLog() {this->SetOperation(VTK_LOG);};
109 
112  void SetOperationToAbsoluteValue() {this->SetOperation(VTK_ABS);};
113 
116  void SetOperationToSquare() {this->SetOperation(VTK_SQR);};
117 
120  void SetOperationToSquareRoot() {this->SetOperation(VTK_SQRT);};
121 
125  void SetOperationToMin() {this->SetOperation(VTK_MIN);};
126 
130  void SetOperationToMax() {this->SetOperation(VTK_MAX);};
131 
134  void SetOperationToATAN() {this->SetOperation(VTK_ATAN);};
135 
136  void SetOperationToATAN2() {this->SetOperation(VTK_ATAN2);};
137 
140  void SetOperationToMultiplyByK() {this->SetOperation(VTK_MULTIPLYBYK);};
141 
144  void SetOperationToAddConstant() {this->SetOperation(VTK_ADDC);};
145 
148  void SetOperationToReplaceCByK() {this->SetOperation(VTK_REPLACECBYK);};
149 
151 
153  vtkSetMacro(ConstantK,double);
154  vtkGetMacro(ConstantK,double);
156 
158 
160  vtkSetMacro(ConstantC,double);
161  vtkGetMacro(ConstantC,double);
163 
165 
166  vtkSetMacro(DivideByZeroToC,int);
167  vtkGetMacro(DivideByZeroToC,int);
168  vtkBooleanMacro(DivideByZeroToC,int);
170 
172 
174  virtual void SetInput1(vtkDataObject *in) { this->SetInput(0,in); }
175  virtual void SetInput2(vtkDataObject *in) { this->SetInput(1,in); }
177 
178 protected:
181 
182  int Operation;
183  double ConstantK;
184  double ConstantC;
186 
187  virtual int RequestInformation (vtkInformation *,
190 
191  virtual void ThreadedRequestData(vtkInformation *request,
192  vtkInformationVector **inputVector,
193  vtkInformationVector *outputVector,
194  vtkImageData ***inData,
195  vtkImageData **outData,
196  int extent[6], int threadId);
197 
199 
200 private:
201  vtkImageMathematics(const vtkImageMathematics&); // Not implemented.
202  void operator=(const vtkImageMathematics&); // Not implemented.
203 };
204 
205 #endif
206