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:
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
61  {
62  this->SetInputConnection(1, output);
63  }
64  void SetImageData(vtkDataObject *image) {this->SetInputData(1,image);}
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 
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:
118 
119  // Parameters
123 
124  // Outputs
125  const char *ErrorMessage;
126  double Error;
128 
138 
139  virtual void ThreadedRequestData(vtkInformation *request,
140  vtkInformationVector **inputVector,
141  vtkInformationVector *outputVector,
142  vtkImageData ***inData,
143  vtkImageData **outData,
144  int extent[6], int threadId);
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 
vtkImageDifference::ThresholdedError
double ThresholdedError
Definition: vtkImageDifference.h:127
vtkImageDifference::~vtkImageDifference
~vtkImageDifference()
Definition: vtkImageDifference.h:117
vtkImageDifference::GetThresholdedError
void GetThresholdedError(double *e)
Definition: vtkImageDifference.h:80
vtkImageDifference::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
vtkImageDifference::SetImageData
void SetImageData(vtkDataObject *image)
Definition: vtkImageDifference.h:64
vtkImageDifference::SetImageConnection
void SetImageConnection(vtkAlgorithmOutput *output)
Specify the Image to compare the input to.
Definition: vtkImageDifference.h:60
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkImageDifference
Compares images for regression tests.
Definition: vtkImageDifference.h:50
vtkX3D::image
@ image
Definition: vtkX3D.h:374
vtkThreadedImageAlgorithm
Generic filter that has one input.
Definition: vtkThreadedImageAlgorithm.h:44
vtkImageDifference::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkImageDifference::New
static vtkImageDifference * New()
vtkImageDifference::GetError
void GetError(double *e)
Definition: vtkImageDifference.h:72
vtkThreadedImageAlgorithm.h
vtkDax::Threshold
int Threshold(vtkDataSet *input, vtkUnstructuredGrid *output, vtkDataArray *field, double lower, double upper)
Definition: vtkDaxThresholdImpl.h:147
vtkImageAlgorithm::SetInputData
void SetInputData(vtkDataObject *)
Assign a data object as input.
vtkImageDifference::GetThresholdedError
double GetThresholdedError()
Return the total thresholded error in comparing the two images.
Definition: vtkImageDifference.h:79
vtkImageDifference::ThreadData
vtkImageDifferenceThreadData * ThreadData
Definition: vtkImageDifference.h:147
vtkImageDifference::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkImageDifference::GetError
double GetError()
Return the total error in comparing the two images.
Definition: vtkImageDifference.h:71
vtkImageDifference::SMPThreadData
vtkImageDifferenceSMPThreadLocal * SMPThreadData
Definition: vtkImageDifference.h:150
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkImageDifference::AllowShift
int AllowShift
Definition: vtkImageDifference.h:120
vtkImageDifference::GetImage
vtkImageData * GetImage()
vtkImageDifference::ErrorMessage
const char * ErrorMessage
Definition: vtkImageDifference.h:125
vtkImageDifference::ThreadedRequestData
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
If the subclass does not define an Execute method, then the task will be broken up,...
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkAlgorithm::SetInputConnection
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkImageDifference::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkImageDifference::Error
double Error
Definition: vtkImageDifference.h:126
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:40
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkImageDifference::vtkImageDifference
vtkImageDifference()
vtkImageDifference::Threshold
int Threshold
Definition: vtkImageDifference.h:121
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkImageDifference::Averaging
int Averaging
Definition: vtkImageDifference.h:122