VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageDifference.h 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 __vtkImageDifference_h 00040 #define __vtkImageDifference_h 00041 00042 #include "vtkImagingCoreModule.h" // For export macro 00043 #include "vtkThreadedImageAlgorithm.h" 00044 00045 class VTKIMAGINGCORE_EXPORT vtkImageDifference : public vtkThreadedImageAlgorithm 00046 { 00047 public: 00048 static vtkImageDifference *New(); 00049 vtkTypeMacro(vtkImageDifference,vtkThreadedImageAlgorithm); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00053 00054 void SetImageConnection(vtkAlgorithmOutput* output) 00055 { 00056 this->SetInputConnection(1, output); 00057 } 00058 void SetImageData(vtkDataObject *image) {this->SetInputData(1,image);} 00059 vtkImageData *GetImage(); 00061 00063 00064 double GetError(void); 00065 void GetError(double *e) { *e = this->GetError(); }; 00067 00069 00072 double GetThresholdedError(void); 00073 void GetThresholdedError(double *e) { *e = this->GetThresholdedError(); }; 00075 00076 00078 00079 vtkSetMacro(Threshold,int); 00080 vtkGetMacro(Threshold,int); 00082 00084 00089 vtkSetMacro(AllowShift,int); 00090 vtkGetMacro(AllowShift,int); 00091 vtkBooleanMacro(AllowShift,int); 00093 00095 00098 vtkSetMacro(Averaging,int); 00099 vtkGetMacro(Averaging,int); 00100 vtkBooleanMacro(Averaging,int); 00102 00103 protected: 00104 vtkImageDifference(); 00105 ~vtkImageDifference() {}; 00106 00107 double ErrorPerThread[VTK_MAX_THREADS]; 00108 double ThresholdedErrorPerThread[VTK_MAX_THREADS]; 00109 int AllowShift; 00110 int Threshold; 00111 int Averaging; 00112 00113 virtual int RequestInformation (vtkInformation *, 00114 vtkInformationVector **, 00115 vtkInformationVector *); 00116 virtual int RequestUpdateExtent(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 private: 00128 vtkImageDifference(const vtkImageDifference&); // Not implemented. 00129 void operator=(const vtkImageDifference&); // Not implemented. 00130 }; 00131 00132 #endif 00133 00134