Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Imaging/vtkImageMathematics.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkImageMathematics.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00026 #ifndef __vtkImageMathematics_h 00027 #define __vtkImageMathematics_h 00028 00029 00030 // Operation options. 00031 #define VTK_ADD 0 00032 #define VTK_SUBTRACT 1 00033 #define VTK_MULTIPLY 2 00034 #define VTK_DIVIDE 3 00035 #define VTK_INVERT 4 00036 #define VTK_SIN 5 00037 #define VTK_COS 6 00038 #define VTK_EXP 7 00039 #define VTK_LOG 8 00040 #define VTK_ABS 9 00041 #define VTK_SQR 10 00042 #define VTK_SQRT 11 00043 #define VTK_MIN 12 00044 #define VTK_MAX 13 00045 #define VTK_ATAN 14 00046 #define VTK_ATAN2 15 00047 #define VTK_MULTIPLYBYK 16 00048 #define VTK_ADDC 17 00049 #define VTK_CONJUGATE 18 00050 #define VTK_COMPLEX_MULTIPLY 19 00051 #define VTK_REPLACECBYK 20 00052 00053 #include "vtkImageTwoInputFilter.h" 00054 00055 class VTK_IMAGING_EXPORT vtkImageMathematics : public vtkImageTwoInputFilter 00056 { 00057 public: 00058 static vtkImageMathematics *New(); 00059 vtkTypeRevisionMacro(vtkImageMathematics,vtkImageTwoInputFilter); 00060 void PrintSelf(ostream& os, vtkIndent indent); 00061 00063 00064 vtkSetMacro(Operation,int); 00065 vtkGetMacro(Operation,int); 00066 void SetOperationToAdd() {this->SetOperation(VTK_ADD);}; 00067 void SetOperationToSubtract() {this->SetOperation(VTK_SUBTRACT);}; 00068 void SetOperationToMultiply() {this->SetOperation(VTK_MULTIPLY);}; 00069 void SetOperationToDivide() {this->SetOperation(VTK_DIVIDE);}; 00070 void SetOperationToConjugate() {this->SetOperation(VTK_CONJUGATE);}; 00071 void SetOperationToComplexMultiply() 00072 {this->SetOperation(VTK_COMPLEX_MULTIPLY);}; 00074 00075 void SetOperationToInvert() {this->SetOperation(VTK_INVERT);}; 00076 void SetOperationToSin() {this->SetOperation(VTK_SIN);}; 00077 void SetOperationToCos() {this->SetOperation(VTK_COS);}; 00078 void SetOperationToExp() {this->SetOperation(VTK_EXP);}; 00079 void SetOperationToLog() {this->SetOperation(VTK_LOG);}; 00080 void SetOperationToAbsoluteValue() {this->SetOperation(VTK_ABS);}; 00081 void SetOperationToSquare() {this->SetOperation(VTK_SQR);}; 00082 void SetOperationToSquareRoot() {this->SetOperation(VTK_SQRT);}; 00083 void SetOperationToMin() {this->SetOperation(VTK_MIN);}; 00084 void SetOperationToMax() {this->SetOperation(VTK_MAX);}; 00085 00086 void SetOperationToATAN() {this->SetOperation(VTK_ATAN);}; 00087 void SetOperationToATAN2() {this->SetOperation(VTK_ATAN2);}; 00088 void SetOperationToMultiplyByK() {this->SetOperation(VTK_MULTIPLYBYK);}; 00089 void SetOperationToAddConstant() {this->SetOperation(VTK_ADDC);}; 00090 void SetOperationToReplaceCByK() {this->SetOperation(VTK_REPLACECBYK);}; 00091 vtkSetMacro(ConstantK,double); 00092 vtkGetMacro(ConstantK,double); 00093 vtkSetMacro(ConstantC,double); 00094 vtkGetMacro(ConstantC,double); 00095 00096 // How to handle divide by zero 00097 vtkSetMacro(DivideByZeroToC,int); 00098 vtkGetMacro(DivideByZeroToC,int); 00099 vtkBooleanMacro(DivideByZeroToC,int); 00100 00101 protected: 00102 vtkImageMathematics(); 00103 ~vtkImageMathematics() {}; 00104 00105 int Operation; 00106 double ConstantK; 00107 double ConstantC; 00108 int DivideByZeroToC; 00109 00110 void ExecuteInformation(vtkImageData **inDatas, vtkImageData *outData); 00111 void ExecuteInformation(){this->vtkImageTwoInputFilter::ExecuteInformation();}; 00112 void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData, 00113 int extent[6], int id); 00114 private: 00115 vtkImageMathematics(const vtkImageMathematics&); // Not implemented. 00116 void operator=(const vtkImageMathematics&); // Not implemented. 00117 }; 00118 00119 #endif 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132