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:
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 
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 
vtkImageMathematics::DivideByZeroToC
int DivideByZeroToC
Definition: vtkImageMathematics.h:186
vtkImageMathematics::SetOperationToSubtract
void SetOperationToSubtract()
Definition: vtkImageMathematics.h:76
VTK_COS
#define VTK_COS
Definition: vtkImageMathematics.h:38
vtkImageMathematics::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
VTK_SQRT
#define VTK_SQRT
Definition: vtkImageMathematics.h:43
vtkImageMathematics::SetOperationToAddConstant
void SetOperationToAddConstant()
Definition: vtkImageMathematics.h:145
vtkImageMathematics::SetOperationToMin
void SetOperationToMin()
Definition: vtkImageMathematics.h:126
VTK_ADDC
#define VTK_ADDC
Definition: vtkImageMathematics.h:49
vtkImageMathematics::New
static vtkImageMathematics * New()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageMathematics::Operation
int Operation
Definition: vtkImageMathematics.h:183
vtkImageMathematics::SetOperationToInvert
void SetOperationToInvert()
Definition: vtkImageMathematics.h:93
vtkImagingMathModule.h
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkThreadedImageAlgorithm
Generic filter that has one input..
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageMathematics
Add, subtract, multiply, divide, invert, sin, cos, exp, log.
Definition: vtkImageMathematics.h:58
vtkImageMathematics::vtkImageMathematics
vtkImageMathematics()
vtkImageMathematics::SetOperationToLog
void SetOperationToLog()
Definition: vtkImageMathematics.h:109
vtkImageMathematics::SetOperationToMax
void SetOperationToMax()
Definition: vtkImageMathematics.h:131
vtkImageMathematics::SetOperationToExp
void SetOperationToExp()
Definition: vtkImageMathematics.h:105
VTK_ADD
#define VTK_ADD
Definition: vtkImageMathematics.h:32
vtkgl::in
GLuint in
Definition: vtkgl.h:16905
VTK_MULTIPLY
#define VTK_MULTIPLY
Definition: vtkImageMathematics.h:34
vtkThreadedImageAlgorithm.h
VTK_MAX
#define VTK_MAX
Definition: vtkImageMathematics.h:45
vtkImageAlgorithm::SetInputData
void SetInputData(vtkDataObject *)
VTK_ABS
#define VTK_ABS
Definition: vtkImageMathematics.h:41
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkImageMathematics::SetOperationToAdd
void SetOperationToAdd()
Definition: vtkImageMathematics.h:72
VTK_MULTIPLYBYK
#define VTK_MULTIPLYBYK
Definition: vtkImageMathematics.h:48
vtkImageMathematics::SetOperationToSquare
void SetOperationToSquare()
Definition: vtkImageMathematics.h:117
VTK_DIVIDE
#define VTK_DIVIDE
Definition: vtkImageMathematics.h:35
VTK_INVERT
#define VTK_INVERT
Definition: vtkImageMathematics.h:36
VTK_SUBTRACT
#define VTK_SUBTRACT
Definition: vtkImageMathematics.h:33
VTK_CONJUGATE
#define VTK_CONJUGATE
Definition: vtkImageMathematics.h:50
VTK_ATAN
#define VTK_ATAN
Definition: vtkImageMathematics.h:46
vtkImageMathematics::SetOperationToDivide
void SetOperationToDivide()
Definition: vtkImageMathematics.h:84
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImageMathematics::SetOperationToMultiply
void SetOperationToMultiply()
Definition: vtkImageMathematics.h:80
vtkImageMathematics::SetOperationToComplexMultiply
void SetOperationToComplexMultiply()
Definition: vtkImageMathematics.h:88
vtkImageMathematics::SetOperationToSin
void SetOperationToSin()
Definition: vtkImageMathematics.h:97
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkImageMathematics::SetOperationToCos
void SetOperationToCos()
Definition: vtkImageMathematics.h:101
vtkImageMathematics::SetInput2Data
virtual void SetInput2Data(vtkDataObject *in)
Definition: vtkImageMathematics.h:176
vtkImageMathematics::ConstantC
double ConstantC
Definition: vtkImageMathematics.h:185
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkX3D::info
@ info
Definition: vtkX3D.h:376
VTK_REPLACECBYK
#define VTK_REPLACECBYK
Definition: vtkImageMathematics.h:52
VTK_MIN
#define VTK_MIN
Definition: vtkImageMathematics.h:44
VTK_ATAN2
#define VTK_ATAN2
Definition: vtkImageMathematics.h:47
vtkImageMathematics::SetOperationToATAN
void SetOperationToATAN()
Definition: vtkImageMathematics.h:135
VTK_COMPLEX_MULTIPLY
#define VTK_COMPLEX_MULTIPLY
Definition: vtkImageMathematics.h:51
vtkImageMathematics::SetOperationToSquareRoot
void SetOperationToSquareRoot()
Definition: vtkImageMathematics.h:121
vtkImageMathematics::SetInput1Data
virtual void SetInput1Data(vtkDataObject *in)
Definition: vtkImageMathematics.h:175
vtkImageMathematics::SetOperationToATAN2
void SetOperationToATAN2()
Definition: vtkImageMathematics.h:137
vtkImageMathematics::SetOperationToReplaceCByK
void SetOperationToReplaceCByK()
Definition: vtkImageMathematics.h:149
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkImageMathematics::~vtkImageMathematics
~vtkImageMathematics()
Definition: vtkImageMathematics.h:181
VTK_LOG
#define VTK_LOG
Definition: vtkImageMathematics.h:40
VTK_EXP
#define VTK_EXP
Definition: vtkImageMathematics.h:39
vtkImageMathematics::ThreadedRequestData
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
vtkImageMathematics::SetOperationToAbsoluteValue
void SetOperationToAbsoluteValue()
Definition: vtkImageMathematics.h:113
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkImageMathematics::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkImageMathematics::ConstantK
double ConstantK
Definition: vtkImageMathematics.h:184
vtkImageMathematics::SetOperationToMultiplyByK
void SetOperationToMultiplyByK()
Definition: vtkImageMathematics.h:141
VTKIMAGINGMATH_EXPORT
#define VTKIMAGINGMATH_EXPORT
Definition: vtkImagingMathModule.h:15
vtkImageMathematics::SetOperationToConjugate
void SetOperationToConjugate()
Definition: vtkImageMathematics.h:86
vtkImageMathematics::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
VTK_SIN
#define VTK_SIN
Definition: vtkImageMathematics.h:37
VTK_SQR
#define VTK_SQR
Definition: vtkImageMathematics.h:42