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 =========================================================================*/
37 #ifndef vtkImageDifference_h
38 #define vtkImageDifference_h
39 
40 #include "vtkImagingCoreModule.h" // For export macro
42 
43 class vtkImageDifferenceThreadData;
44 class vtkImageDifferenceSMPThreadLocal;
45 
46 class VTKIMAGINGCORE_EXPORT vtkImageDifference : public vtkThreadedImageAlgorithm
47 {
48 public:
49  static vtkImageDifference *New();
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
52 
54 
58  {
59  this->SetInputConnection(1, output);
60  }
61  void SetImageData(vtkDataObject *image) {this->SetInputData(1,image);}
62  vtkImageData *GetImage();
64 
68  double GetError() { return this->Error; }
69  void GetError(double *e) { *e = this->GetError(); };
70 
76  double GetThresholdedError() { return this->ThresholdedError; }
77  void GetThresholdedError(double *e) { *e = this->GetThresholdedError(); };
78 
80 
83  vtkSetMacro(Threshold,int);
84  vtkGetMacro(Threshold,int);
86 
88 
95  vtkSetMacro(AllowShift,int);
96  vtkGetMacro(AllowShift,int);
97  vtkBooleanMacro(AllowShift,int);
99 
101 
107  vtkSetMacro(Averaging,int);
108  vtkGetMacro(Averaging,int);
109  vtkBooleanMacro(Averaging,int);
111 
112 protected:
114  ~vtkImageDifference() VTK_OVERRIDE {}
115 
116  // Parameters
120 
121  // Outputs
122  const char *ErrorMessage;
123  double Error;
125 
128  vtkInformationVector *) VTK_OVERRIDE;
129  int RequestUpdateExtent(vtkInformation *,
131  vtkInformationVector *) VTK_OVERRIDE;
132  int RequestData(vtkInformation *,
133  vtkInformationVector **,
134  vtkInformationVector *) VTK_OVERRIDE;
135 
136  void ThreadedRequestData(vtkInformation *request,
137  vtkInformationVector **inputVector,
138  vtkInformationVector *outputVector,
139  vtkImageData ***inData,
140  vtkImageData **outData,
141  int extent[6], int threadId) VTK_OVERRIDE;
142 
143  // Used for vtkMultiThreader operation.
144  vtkImageDifferenceThreadData *ThreadData;
145 
146  // Used for vtkSMPTools operation.
147  vtkImageDifferenceSMPThreadLocal *SMPThreadData;
148 
149 private:
150  vtkImageDifference(const vtkImageDifference&) VTK_DELETE_FUNCTION;
151  void operator=(const vtkImageDifference&) VTK_DELETE_FUNCTION;
152 
153  friend class vtkImageDifferenceSMPFunctor;
154 };
155 
156 #endif
157 
158 
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:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
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:58