00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00037 #ifndef __vtkImageComparison_h
00038 #define __vtkImageComparison_h
00039
00040
00041
00042 #define VTK_GREATER_THAN 0
00043 #define VTK_LESS_THAN 1
00044 #define VTK_GREATER_THAN_EQUAL 2
00045 #define VTK_LESS_THAN_EQUAL 3
00046 #define VTK_EQUAL 4
00047
00048 #include "vtkThreadedImageAlgorithm.h"
00049 #include "vtkCNMRRImagingWin32Header.h"
00050
00051 class VTK_CNMRR_IMAGING_EXPORT vtkImageComparison :
00052 public vtkThreadedImageAlgorithm
00053 {
00054 public:
00055 static vtkImageComparison *New();
00056 vtkTypeRevisionMacro(vtkImageComparison,vtkThreadedImageAlgorithm);
00057 void PrintSelf(ostream& os, vtkIndent indent);
00058
00060
00061 vtkSetMacro(Operation,int);
00062 vtkGetMacro(Operation,int);
00063 void SetOperationToGreaterThan()
00064 {this->SetOperation(VTK_GREATER_THAN);}
00065 void SetOperationToLessThan()
00066 {this->SetOperation(VTK_LESS_THAN);}
00067 void SetOperationToGreaterThanEqual()
00068 {this->SetOperation(VTK_GREATER_THAN_EQUAL);}
00069 void SetOperationToLessThanEqual()
00070 {this->SetOperation(VTK_LESS_THAN_EQUAL);}
00071 void SetOperationToEqual()
00072 {this->SetOperation(VTK_EQUAL);}
00074
00075 vtkSetMacro(ConstantC,double);
00076 vtkGetMacro(ConstantC,double);
00077
00079
00080 vtkSetMacro(OutputTrueValue, double);
00081 vtkGetMacro(OutputTrueValue, double);
00083
00085
00086 virtual void SetInput1(vtkDataObject *in) { this->SetInput(0,in); }
00087 virtual void SetInput2(vtkDataObject *in) { this->SetInput(1,in); }
00089
00091
00092 vtkSetMacro(OutputScalarType, int);
00093 vtkGetMacro(OutputScalarType, int);
00094 void SetOutputScalarTypeToDouble()
00095 {this->SetOutputScalarType(VTK_DOUBLE);}
00096 void SetOutputScalarTypeToFloat()
00097 {this->SetOutputScalarType(VTK_FLOAT);}
00098 void SetOutputScalarTypeToLong()
00099 {this->SetOutputScalarType(VTK_LONG);}
00100 void SetOutputScalarTypeToUnsignedLong()
00101 {this->SetOutputScalarType(VTK_UNSIGNED_LONG);}
00102 void SetOutputScalarTypeToInt()
00103 {this->SetOutputScalarType(VTK_INT);}
00104 void SetOutputScalarTypeToUnsignedInt()
00105 {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
00106 void SetOutputScalarTypeToShort()
00107 {this->SetOutputScalarType(VTK_SHORT);}
00108 void SetOutputScalarTypeToUnsignedShort()
00109 {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
00110 void SetOutputScalarTypeToChar()
00111 {this->SetOutputScalarType(VTK_CHAR);}
00112 void SetOutputScalarTypeToSignedChar()
00113 {this->SetOutputScalarType(VTK_SIGNED_CHAR);}
00114 void SetOutputScalarTypeToUnsignedChar()
00115 {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
00117
00118 protected:
00119 vtkImageComparison();
00120 ~vtkImageComparison() {};
00121
00122 int Operation;
00123 double ConstantC;
00124 double OutputTrueValue;
00125 int OutputScalarType;
00126
00127 virtual int RequestInformation (vtkInformation *,
00128 vtkInformationVector **,
00129 vtkInformationVector *);
00130
00131 virtual void ThreadedRequestData(vtkInformation *request,
00132 vtkInformationVector **inputVector,
00133 vtkInformationVector *outputVector,
00134 vtkImageData ***inData,
00135 vtkImageData **outData,
00136 int extent[6], int threadId);
00137
00138 virtual int FillInputPortInformation(int port, vtkInformation* info);
00139
00140 private:
00141 vtkImageComparison(const vtkImageComparison&);
00142 void operator=(const vtkImageComparison&);
00143 };
00144
00145 #endif