VTK  9.1.0
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 =========================================================================*/
29 #ifndef vtkImageDifference_h
30 #define vtkImageDifference_h
31 
32 #include "vtkImagingCoreModule.h" // For export macro
34 
35 class vtkImageDifferenceThreadData;
36 class vtkImageDifferenceSMPThreadLocal;
37 
38 class VTKIMAGINGCORE_EXPORT vtkImageDifference : public vtkThreadedImageAlgorithm
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
49  void SetImageConnection(vtkAlgorithmOutput* output) { this->SetInputConnection(1, output); }
50  void SetImageData(vtkDataObject* image) { this->SetInputData(1, image); }
53 
57  double GetError() { return this->Error; }
58  void GetError(double* e) { *e = this->GetError(); }
59 
65  double GetThresholdedError() { return this->ThresholdedError; }
66  void GetThresholdedError(double* e) { *e = this->GetThresholdedError(); }
67 
69 
72  vtkSetMacro(Threshold, int);
73  vtkGetMacro(Threshold, int);
75 
77 
84  vtkSetMacro(AllowShift, vtkTypeBool);
85  vtkGetMacro(AllowShift, vtkTypeBool);
86  vtkBooleanMacro(AllowShift, vtkTypeBool);
88 
90 
96  vtkSetMacro(Averaging, vtkTypeBool);
97  vtkGetMacro(Averaging, vtkTypeBool);
98  vtkBooleanMacro(Averaging, vtkTypeBool);
100 
102 
106  vtkSetMacro(AverageThresholdFactor, double);
107  vtkGetMacro(AverageThresholdFactor, double);
109 
110 protected:
112  ~vtkImageDifference() override = default;
113 
114  // Parameters
118 
119  // Outputs
120  const char* ErrorMessage;
121  double Error;
124 
128 
130  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
131  int outExt[6], int threadId) override;
132 
133  // Used for vtkMultiThreader operation.
134  vtkImageDifferenceThreadData* ThreadData;
135 
136  // Used for vtkSMPTools operation.
137  vtkImageDifferenceSMPThreadLocal* SMPThreadData;
138 
139 private:
140  vtkImageDifference(const vtkImageDifference&) = delete;
141  void operator=(const vtkImageDifference&) = delete;
142 
143  friend class vtkImageDifferenceSMPFunctor;
144 };
145 
146 #endif
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:60
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:48
Compares images for regression tests.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImageDifference * New()
vtkImageData * GetImage()
Specify the Image to compare the input to.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int outExt[6], int threadId) override
If the subclass does not define an Execute method, then the task will be broken up,...
void GetError(double *e)
vtkImageDifferenceSMPThreadLocal * SMPThreadData
void SetImageConnection(vtkAlgorithmOutput *output)
Specify the Image to compare the input to.
~vtkImageDifference() override=default
double GetThresholdedError()
Return the total thresholded error in comparing the two images.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageDifferenceThreadData * ThreadData
double GetError()
Return the total error in comparing the two images.
void SetImageData(vtkDataObject *image)
Specify the Image to compare the input to.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void GetThresholdedError(double *e)
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
@ image
Definition: vtkX3D.h:380
int vtkTypeBool
Definition: vtkABI.h:69