VTK
vtkImageDifference.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageDifference.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
40 #ifndef vtkImageDifference_h
41 #define vtkImageDifference_h
42 
43 #include "vtkImagingCoreModule.h" // For export macro
45 
46 class vtkImageDifferenceThreadData;
47 class vtkImageDifferenceSMPThreadLocal;
48 
49 class VTKIMAGINGCORE_EXPORT vtkImageDifference : public vtkThreadedImageAlgorithm
50 {
51 public:
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
61  {
62  this->SetInputConnection(1, output);
63  }
64  void SetImageData(vtkDataObject *image) {this->SetInputData(1,image);}
67 
71  double GetError() { return this->Error; }
72  void GetError(double *e) { *e = this->GetError(); };
73 
79  double GetThresholdedError() { return this->ThresholdedError; }
80  void GetThresholdedError(double *e) { *e = this->GetThresholdedError(); };
81 
83 
87  vtkGetMacro(Threshold,int);
89 
91 
98  vtkSetMacro(AllowShift,int);
99  vtkGetMacro(AllowShift,int);
100  vtkBooleanMacro(AllowShift,int);
102 
104 
110  vtkSetMacro(Averaging,int);
111  vtkGetMacro(Averaging,int);
112  vtkBooleanMacro(Averaging,int);
114 
115 protected:
118 
119  // Parameters
123 
124  // Outputs
125  const char *ErrorMessage;
126  double Error;
128 
138 
139  virtual void ThreadedRequestData(vtkInformation *request,
140  vtkInformationVector **inputVector,
141  vtkInformationVector *outputVector,
142  vtkImageData ***inData,
143  vtkImageData **outData,
144  int extent[6], int threadId);
145 
146  // Used for vtkMultiThreader operation.
147  vtkImageDifferenceThreadData *ThreadData;
148 
149  // Used for vtkSMPTools operation.
150  vtkImageDifferenceSMPThreadLocal *SMPThreadData;
151 
152 private:
153  vtkImageDifference(const vtkImageDifference&) VTK_DELETE_FUNCTION;
154  void operator=(const vtkImageDifference&) VTK_DELETE_FUNCTION;
155 
156  friend class vtkImageDifferenceSMPFunctor;
157 };
158 
159 #endif
160 
161 
Proxy object to connect input/output ports.
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
general representation of visualization data
Definition: vtkDataObject.h:65
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
Compares images for regression tests.
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up,...
static vtkImageDifference * New()
vtkImageData * GetImage()
void GetError(double *e)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkImageDifferenceSMPThreadLocal * SMPThreadData
void SetImageConnection(vtkAlgorithmOutput *output)
Specify the Image to compare the input to.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to collect information from their inputs and set information f...
double GetThresholdedError()
Return the total thresholded error in comparing the two images.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkImageDifferenceThreadData * ThreadData
double GetError()
Return the total error in comparing the two images.
void SetImageData(vtkDataObject *image)
void GetThresholdedError(double *e)
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int Threshold(vtkDataSet *input, vtkUnstructuredGrid *output, vtkDataArray *field, double lower, double upper)
@ extent
Definition: vtkX3D.h:345
@ image
Definition: vtkX3D.h:374
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.