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=========================================================================*/
38#ifndef vtkImageDifference_h
39#define vtkImageDifference_h
40
41#include "vtkImagingCoreModule.h" // For export macro
43
44class vtkImageDifferenceThreadData;
45class vtkImageDifferenceSMPThreadLocal;
46
47class VTKIMAGINGCORE_EXPORT vtkImageDifference : public vtkThreadedImageAlgorithm
48{
49public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
58 void SetImageConnection(vtkAlgorithmOutput* output) { this->SetInputConnection(1, output); }
59 void SetImageData(vtkDataObject* image) { this->SetInputData(1, image); }
62
66 double GetError() { return this->Error; }
67 void GetError(double* e) { *e = this->GetError(); }
68
74 double GetThresholdedError() { return this->ThresholdedError; }
75 void GetThresholdedError(double* e) { *e = this->GetThresholdedError(); }
76
78
81 vtkSetMacro(Threshold, int);
82 vtkGetMacro(Threshold, int);
84
86
93 vtkSetMacro(AllowShift, vtkTypeBool);
94 vtkGetMacro(AllowShift, vtkTypeBool);
95 vtkBooleanMacro(AllowShift, vtkTypeBool);
97
99
105 vtkSetMacro(Averaging, vtkTypeBool);
106 vtkGetMacro(Averaging, vtkTypeBool);
107 vtkBooleanMacro(Averaging, vtkTypeBool);
109
111
115 vtkSetMacro(AverageThresholdFactor, double);
116 vtkGetMacro(AverageThresholdFactor, double);
118
119protected:
121 ~vtkImageDifference() override = default;
122
123 // Parameters
127
128 // Outputs
129 const char* ErrorMessage;
130 double Error;
133
137
139 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
140 int outExt[6], int threadId) override;
141
142 // Used for vtkMultiThreader operation.
143 vtkImageDifferenceThreadData* ThreadData;
144
145 // Used for vtkSMPTools operation.
146 vtkImageDifferenceSMPThreadLocal* SMPThreadData;
147
148private:
149 vtkImageDifference(const vtkImageDifference&) = delete;
150 void operator=(const vtkImageDifference&) = delete;
151
152 friend class vtkImageDifferenceSMPFunctor;
153};
154
155#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:69
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
Compares images for regression tests.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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.
static vtkImageDifference * New()
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.
vtkImageData * GetImage()
Specify the Image to compare the input to.
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:43
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