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:
52  static vtkImageDifference *New();
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);}
65  vtkImageData *GetImage();
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 
129  virtual int RequestInformation (vtkInformation *,
132  virtual int RequestUpdateExtent(vtkInformation *,
135  virtual int RequestData(vtkInformation *,
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 
void GetError(double *e)
Store vtkAlgorithm input/output information.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
Compares images for regression tests.
void SetImageData(vtkDataObject *image)
Specify the Image to compare the input to.
void GetThresholdedError(double *e)
void SetInputData(vtkDataObject *)
Assign a data object as input.
double GetError()
Return the total error in comparing the two images.
void SetImageConnection(vtkAlgorithmOutput *output)
Specify the Image to compare the input to.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
Proxy object to connect input/output ports.
Generic filter that has one input.
a simple class to control print indentation
Definition: vtkIndent.h:39
int Threshold(vtkDataSet *input, vtkUnstructuredGrid *output, vtkDataArray *field, double lower, double upper)
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
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, multiple threads will be spawned, and each thread will call this method.
vtkImageDifferenceThreadData * ThreadData
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkImageDifferenceSMPThreadLocal * SMPThreadData
double GetThresholdedError()
Return the total thresholded error in comparing the two images.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64