Imaging/vtkImageMathematics.h Source File

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

# Imaging/vtkImageMathematics.h

Go to the documentation of this file.

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