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

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 =========================================================================*/
00039 #ifndef __vtkImageMathematics_h
00040 #define __vtkImageMathematics_h
00041 
00042 
00043 // Operation options.
00044 #define VTK_ADD                0
00045 #define VTK_SUBTRACT           1
00046 #define VTK_MULTIPLY           2
00047 #define VTK_DIVIDE             3
00048 #define VTK_INVERT             4  
00049 #define VTK_SIN                5
00050 #define VTK_COS                6
00051 #define VTK_EXP                7
00052 #define VTK_LOG                8
00053 #define VTK_ABS                9
00054 #define VTK_SQR               10
00055 #define VTK_SQRT              11
00056 #define VTK_MIN               12
00057 #define VTK_MAX               13
00058 #define VTK_ATAN              14
00059 #define VTK_ATAN2             15
00060 #define VTK_MULTIPLYBYK       16
00061 #define VTK_ADDC              17
00062 #define VTK_CONJUGATE         18
00063 #define VTK_COMPLEX_MULTIPLY  19
00064 #define VTK_REPLACECBYK       20
00065 
00066 #include "vtkImageTwoInputFilter.h"
00067 
00068 class VTK_IMAGING_EXPORT vtkImageMathematics : public vtkImageTwoInputFilter
00069 {
00070 public:
00071   static vtkImageMathematics *New();
00072   vtkTypeRevisionMacro(vtkImageMathematics,vtkImageTwoInputFilter);
00073   void PrintSelf(ostream& os, vtkIndent indent);
00074 
00076 
00077   vtkSetMacro(Operation,int);
00078   vtkGetMacro(Operation,int);
00079   void SetOperationToAdd() {this->SetOperation(VTK_ADD);};
00080   void SetOperationToSubtract() {this->SetOperation(VTK_SUBTRACT);};
00081   void SetOperationToMultiply() {this->SetOperation(VTK_MULTIPLY);};
00082   void SetOperationToDivide() {this->SetOperation(VTK_DIVIDE);};
00083   void SetOperationToConjugate() {this->SetOperation(VTK_CONJUGATE);};
00084   void SetOperationToComplexMultiply() 
00085     {this->SetOperation(VTK_COMPLEX_MULTIPLY);};
00087 
00088   void SetOperationToInvert() {this->SetOperation(VTK_INVERT);};
00089   void SetOperationToSin() {this->SetOperation(VTK_SIN);};
00090   void SetOperationToCos() {this->SetOperation(VTK_COS);};
00091   void SetOperationToExp() {this->SetOperation(VTK_EXP);};
00092   void SetOperationToLog() {this->SetOperation(VTK_LOG);};
00093   void SetOperationToAbsoluteValue() {this->SetOperation(VTK_ABS);};
00094   void SetOperationToSquare() {this->SetOperation(VTK_SQR);};
00095   void SetOperationToSquareRoot() {this->SetOperation(VTK_SQRT);};
00096   void SetOperationToMin() {this->SetOperation(VTK_MIN);};
00097   void SetOperationToMax() {this->SetOperation(VTK_MAX);};
00098 
00099   void SetOperationToATAN() {this->SetOperation(VTK_ATAN);};
00100   void SetOperationToATAN2() {this->SetOperation(VTK_ATAN2);};
00101   void SetOperationToMultiplyByK() {this->SetOperation(VTK_MULTIPLYBYK);};
00102   void SetOperationToAddConstant() {this->SetOperation(VTK_ADDC);};
00103   void SetOperationToReplaceCByK() {this->SetOperation(VTK_REPLACECBYK);};
00104   vtkSetMacro(ConstantK,double);
00105   vtkGetMacro(ConstantK,double);
00106   vtkSetMacro(ConstantC,double);
00107   vtkGetMacro(ConstantC,double);
00108 
00109   // How to handle divide by zero
00110   vtkSetMacro(DivideByZeroToC,int);
00111   vtkGetMacro(DivideByZeroToC,int);
00112   vtkBooleanMacro(DivideByZeroToC,int);
00113 
00114 protected:
00115   vtkImageMathematics();
00116   ~vtkImageMathematics() {};
00117 
00118   int Operation;
00119   double ConstantK;
00120   double ConstantC;
00121   int DivideByZeroToC;
00122   
00123   void ExecuteInformation(vtkImageData **inDatas, vtkImageData *outData);
00124   void ExecuteInformation(){this->vtkImageTwoInputFilter::ExecuteInformation();};
00125   void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData,
00126                        int extent[6], int id);
00127 private:
00128   vtkImageMathematics(const vtkImageMathematics&);  // Not implemented.
00129   void operator=(const vtkImageMathematics&);  // Not implemented.
00130 };
00131 
00132 #endif
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145