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 =========================================================================*/
48 #ifndef vtkImageDifference_h
49 #define vtkImageDifference_h
50 
51 #include "vtkImagingCoreModule.h" // For export macro
53 
54 class vtkImageDifferenceThreadData;
55 class vtkImageDifferenceSMPThreadLocal;
56 
57 class VTKIMAGINGCORE_EXPORT vtkImageDifference : public vtkThreadedImageAlgorithm
58 {
59 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
68  void SetImageConnection(vtkAlgorithmOutput* output) { this->SetInputConnection(1, output); }
69  void SetImageData(vtkDataObject* image) { this->SetInputData(1, image); }
72 
76  double GetError() { return this->Error; }
77  void GetError(double* e) { *e = this->GetError(); }
78 
84  double GetThresholdedError() { return this->ThresholdedError; }
85  void GetThresholdedError(double* e) { *e = this->GetThresholdedError(); }
86 
88 
91  vtkSetMacro(Threshold, int);
92  vtkGetMacro(Threshold, int);
94 
96 
103  vtkSetMacro(AllowShift, vtkTypeBool);
104  vtkGetMacro(AllowShift, vtkTypeBool);
105  vtkBooleanMacro(AllowShift, vtkTypeBool);
107 
109 
115  vtkSetMacro(Averaging, vtkTypeBool);
116  vtkGetMacro(Averaging, vtkTypeBool);
117  vtkBooleanMacro(Averaging, vtkTypeBool);
119 
121 
125  vtkSetMacro(AverageThresholdFactor, double);
126  vtkGetMacro(AverageThresholdFactor, double);
128 
129 protected:
131  ~vtkImageDifference() override = default;
132 
133  // Parameters
137 
138  // Outputs
139  const char* ErrorMessage;
140  double Error;
143 
147 
149  vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData,
150  int outExt[6], int threadId) override;
151 
152  // Used for vtkMultiThreader operation.
153  vtkImageDifferenceThreadData* ThreadData;
154 
155  // Used for vtkSMPTools operation.
156  vtkImageDifferenceSMPThreadLocal* SMPThreadData;
157 
158 private:
159  vtkImageDifference(const vtkImageDifference&) = delete;
160  void operator=(const vtkImageDifference&) = delete;
161 
162  friend class vtkImageDifferenceSMPFunctor;
163 };
164 
165 #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
void SetInputData(vtkDataObject *)
Assign a data object as input.
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
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:113
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