Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
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 "vtkThreadedImageAlgorithm.h"
00054 
00055 class VTK_IMAGING_EXPORT vtkImageMathematics : public vtkThreadedImageAlgorithm
00056 {
00057 public:
00058   static vtkImageMathematics *New();
00059   vtkTypeRevisionMacro(vtkImageMathematics,vtkThreadedImageAlgorithm);
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 
00102 
00103   virtual void SetInput1(vtkDataObject *in) { this->SetInput(0,in); }
00104   virtual void SetInput2(vtkDataObject *in) { this->SetInput(1,in); }
00106 
00107 protected:
00108   vtkImageMathematics();
00109   ~vtkImageMathematics() {};
00110 
00111   int Operation;
00112   double ConstantK;
00113   double ConstantC;
00114   int DivideByZeroToC;
00115   
00116   virtual int RequestInformation (vtkInformation *, 
00117                                   vtkInformationVector **,
00118                                   vtkInformationVector *);
00119   
00120   virtual void ThreadedRequestData(vtkInformation *request, 
00121                                    vtkInformationVector **inputVector, 
00122                                    vtkInformationVector *outputVector,
00123                                    vtkImageData ***inData, 
00124                                    vtkImageData **outData,
00125                                    int extent[6], int threadId);
00126 
00127   virtual int FillInputPortInformation(int port, vtkInformation* info);
00128 
00129 private:
00130   vtkImageMathematics(const vtkImageMathematics&);  // Not implemented.
00131   void operator=(const vtkImageMathematics&);  // Not implemented.
00132 };
00133 
00134 #endif
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 

Generated on Mon Jan 21 23:07:29 2008 for VTK by  doxygen 1.4.3-20050530