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 
54 #include "vtkImagingMathModule.h" // For export macro
56 
58 {
59 public:
60  static vtkImageMathematics *New();
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
65 
66  vtkSetMacro(Operation,int);
67  vtkGetMacro(Operation,int);
69 
72  void SetOperationToAdd() {this->SetOperation(VTK_ADD);};
73 
76  void SetOperationToSubtract() {this->SetOperation(VTK_SUBTRACT);};
77 
80  void SetOperationToMultiply() {this->SetOperation(VTK_MULTIPLY);};
81 
84  void SetOperationToDivide() {this->SetOperation(VTK_DIVIDE);};
85 
86  void SetOperationToConjugate() {this->SetOperation(VTK_CONJUGATE);};
87 
89  {this->SetOperation(VTK_COMPLEX_MULTIPLY);};
90 
93  void SetOperationToInvert() {this->SetOperation(VTK_INVERT);};
94 
97  void SetOperationToSin() {this->SetOperation(VTK_SIN);};
98 
101  void SetOperationToCos() {this->SetOperation(VTK_COS);};
102 
105  void SetOperationToExp() {this->SetOperation(VTK_EXP);};
106 
109  void SetOperationToLog() {this->SetOperation(VTK_LOG);};
110 
113  void SetOperationToAbsoluteValue() {this->SetOperation(VTK_ABS);};
114 
117  void SetOperationToSquare() {this->SetOperation(VTK_SQR);};
118 
121  void SetOperationToSquareRoot() {this->SetOperation(VTK_SQRT);};
122 
126  void SetOperationToMin() {this->SetOperation(VTK_MIN);};
127 
131  void SetOperationToMax() {this->SetOperation(VTK_MAX);};
132 
135  void SetOperationToATAN() {this->SetOperation(VTK_ATAN);};
136 
137  void SetOperationToATAN2() {this->SetOperation(VTK_ATAN2);};
138 
141  void SetOperationToMultiplyByK() {this->SetOperation(VTK_MULTIPLYBYK);};
142 
145  void SetOperationToAddConstant() {this->SetOperation(VTK_ADDC);};
146 
149  void SetOperationToReplaceCByK() {this->SetOperation(VTK_REPLACECBYK);};
150 
152 
154  vtkSetMacro(ConstantK,double);
155  vtkGetMacro(ConstantK,double);
157 
159 
161  vtkSetMacro(ConstantC,double);
162  vtkGetMacro(ConstantC,double);
164 
166 
167  vtkSetMacro(DivideByZeroToC,int);
168  vtkGetMacro(DivideByZeroToC,int);
169  vtkBooleanMacro(DivideByZeroToC,int);
171 
173 
175  virtual void SetInput1Data(vtkDataObject *in) { this->SetInputData(0,in); }
176  virtual void SetInput2Data(vtkDataObject *in) { this->SetInputData(1,in); }
178 
179 protected:
182 
184  double ConstantK;
185  double ConstantC;
187 
188  virtual int RequestInformation (vtkInformation *,
191 
192  virtual void ThreadedRequestData(vtkInformation *request,
193  vtkInformationVector **inputVector,
194  vtkInformationVector *outputVector,
195  vtkImageData ***inData,
196  vtkImageData **outData,
197  int extent[6], int threadId);
198 
200 
201 private:
202  vtkImageMathematics(const vtkImageMathematics&); // Not implemented.
203  void operator=(const vtkImageMathematics&); // Not implemented.
204 };
205 
206 #endif
207 
#define VTK_SQR
Store vtkAlgorithm input/output information.
#define VTK_SQRT
virtual void SetInput2Data(vtkDataObject *in)
#define VTK_ADDC
#define VTK_ADD
#define VTK_MAX
#define VTK_COS
#define VTK_MULTIPLY
void SetInputData(vtkDataObject *)
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_ABS
#define VTK_DIVIDE
Generic filter that has one input..
#define VTK_CONJUGATE
#define VTK_INVERT
#define VTK_SUBTRACT
#define VTK_MULTIPLYBYK
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTK_ATAN
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
#define VTK_REPLACECBYK
Add, subtract, multiply, divide, invert, sin, cos, exp, log.
#define VTK_MIN
#define VTK_LOG
#define VTK_EXP
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
#define VTK_SIN
#define VTK_ATAN2
#define VTKIMAGINGMATH_EXPORT
general representation of visualization data
Definition: vtkDataObject.h:64
virtual void SetInput1Data(vtkDataObject *in)
#define VTK_COMPLEX_MULTIPLY