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) VTK_OVERRIDE;
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 
86  vtkSetMacro(Threshold,int);
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:
117  ~vtkImageDifference() VTK_OVERRIDE {}
118 
119  // Parameters
123 
124  // Outputs
125  const char *ErrorMessage;
126  double Error;
128 
131  vtkInformationVector *) VTK_OVERRIDE;
132  int RequestUpdateExtent(vtkInformation *,
134  vtkInformationVector *) VTK_OVERRIDE;
135  int RequestData(vtkInformation *,
136  vtkInformationVector **,
137  vtkInformationVector *) VTK_OVERRIDE;
138 
139  void ThreadedRequestData(vtkInformation *request,
140  vtkInformationVector **inputVector,
141  vtkInformationVector *outputVector,
142  vtkImageData ***inData,
143  vtkImageData **outData,
144  int extent[6], int threadId) VTK_OVERRIDE;
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.
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.
Proxy object to connect input/output ports.
Generic filter that has one input.
a simple class to control print indentation
Definition: vtkIndent.h:39
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.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double GetThresholdedError()
Return the total thresholded error in comparing the two images.
~vtkImageDifference() override
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