dox/Imaging/vtkImageComplexMathematics.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   vtkCNMRRLibrary
00004   Module:    $RCSfile: vtkImageComplexMathematics.h,v $
00005 
00006   Copyright  2006  The Pennsylvania State University
00007   
00008           Notice
00009  
00010   The contents of this file are subject to The Pennsylvania State University 
00011   Open Source License (the "License"); you may not use this file except in 
00012   compliance with the License. You may obtain a copy of the License at H066 
00013   Radiology, NMR Building, 500 University Drive, Hershey, PA, 
00014   tel. (717) 531-6069 or via email at dcb210@psu.edu.
00015  
00016   Software distributed under the License is distributed on an "AS IS" basis, 
00017   WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
00018   for the specific language governing rights and limitations under the 
00019   License.
00020  
00021   The Original Code is listed under Exhibit A of the license.
00022  
00023   The Initial Developer of the Original Code is Don Bigler.
00024  
00025   Contributor(s):
00026   
00027 =========================================================================*/
00038 #ifndef __vtkImageComplexMathematics_h
00039 #define __vtkImageComplexMathematics_h
00040 
00041 
00042 // Operation options.
00043 #define VTK_COMPLEX_DIVIDE        0
00044 #define VTK_COMPLEX_MULT          1
00045 #define VTK_COMPLEX_ADD           2
00046 #define VTK_COMPLEX_SUBTRACT      3
00047 #define VTK_COMPLEX_INVERT        4
00048 #define VTK_COMPLEX_CONJUGATE     5
00049 #define VTK_COMPLEX_PHASESHIFTBYK 6
00050 #define VTK_COMPLEX_MAGNITUDE     7
00051 #define VTK_COMPLEX_PHASE90       8
00052 #define VTK_COMPLEX_PHASE180      9
00053 #define VTK_COMPLEX_PHASE360      10
00054 
00055 
00056 #include "vtkThreadedImageAlgorithm.h"
00057 #include "vtkCNMRRImagingWin32Header.h"
00058 
00059 class VTK_CNMRR_IMAGING_EXPORT vtkImageComplexMathematics : public vtkThreadedImageAlgorithm
00060 {
00061 public:
00062   static vtkImageComplexMathematics *New();
00063   vtkTypeRevisionMacro(vtkImageComplexMathematics,vtkThreadedImageAlgorithm);
00064   void PrintSelf(ostream& os, vtkIndent indent);
00065 
00067 
00068   vtkSetMacro(Operation,int);
00069   vtkGetMacro(Operation,int);
00070   void SetOperationToComplexDivide() {this->SetOperation(VTK_COMPLEX_DIVIDE);};
00071   void SetOperationToComplexMultiply() {this->SetOperation(VTK_COMPLEX_MULT);};
00072   void SetOperationToComplexAdd() {this->SetOperation(VTK_COMPLEX_ADD);};
00073   void SetOperationToComplexSubtract() {this->SetOperation(VTK_COMPLEX_SUBTRACT);};
00074   void SetOperationToComplexInvert() {this->SetOperation(VTK_COMPLEX_INVERT);};
00075   void SetOperationToComplexConjugate() {this->SetOperation(VTK_COMPLEX_CONJUGATE);};
00076   void SetOperationToComplexPhaseShiftByK() {this->SetOperation(VTK_COMPLEX_PHASESHIFTBYK);};
00077   void SetOperationToComplexMagnitude() {this->SetOperation(VTK_COMPLEX_MAGNITUDE);};
00078   void SetOperationToComplexPhase90() {this->SetOperation(VTK_COMPLEX_PHASE90);};
00079   void SetOperationToComplexPhase180() {this->SetOperation(VTK_COMPLEX_PHASE180);};
00080   void SetOperationToComplexPhase360() {this->SetOperation(VTK_COMPLEX_PHASE360);};
00081   vtkSetMacro(ConstantC,double);
00082   vtkGetMacro(ConstantC,double);
00083   vtkSetMacro(ConstantK,double);
00084   vtkGetMacro(ConstantK,double);
00086 
00087   // How to handle divide by zero
00088   vtkSetMacro(DivideByZeroToC,int);
00089   vtkGetMacro(DivideByZeroToC,int);
00090   vtkBooleanMacro(DivideByZeroToC,int);
00091   
00093 
00094   virtual void SetInput1(vtkDataObject *in) { this->SetInput(0,in); }
00095   virtual void SetInput2(vtkDataObject *in) { this->SetInput(1,in); }
00097 
00098 protected:
00099   vtkImageComplexMathematics();
00100   ~vtkImageComplexMathematics() {};
00101 
00102   int Operation;
00103   double ConstantC;
00104   double ConstantK;
00105   int DivideByZeroToC;
00106   
00107   virtual int RequestInformation (vtkInformation *, 
00108                                   vtkInformationVector **,
00109                                   vtkInformationVector *);
00110   
00111   virtual void ThreadedRequestData(vtkInformation *request, 
00112                                    vtkInformationVector **inputVector, 
00113                                    vtkInformationVector *outputVector,
00114                                    vtkImageData ***inData, 
00115                                    vtkImageData **outData,
00116                                    int extent[6], int threadId);
00117 
00118   virtual int FillInputPortInformation(int port, vtkInformation* info);
00119      
00120 private:
00121   vtkImageComplexMathematics(const vtkImageComplexMathematics&);  // Not implemented.
00122   void operator=(const vtkImageComplexMathematics&);  // Not implemented.
00123 };
00124 
00125 #endif

Generated on Tue May 12 14:53:03 2009 for vtkCNMRRLibrary by  doxygen 1.4.7