#include <vtkImageDifference.h>
vtkImageDifference takes two rgb unsigned char images and compares them. It allows the images to be slightly different. If AllowShift is on, then each pixel can be shifted by one pixel. Threshold is the allowable error for each pixel.
This is not a symetric filter and the difference computed is not symetric when AllowShift is on. Specifically in that case a pixel in SetImage input will be compared to the matching pixel in the input as well as to the input's eight connected neighbors. BUT... the opposite is not true. So for example if a valid image (SetImage) has a single white pixel in it, it will not find a match in the input image if the input image is black (because none of the nine suspect pixels are white). In contrast, if there is a single white pixel in the input image and the valid image (SetImage) is all black it will match with no error because all it has to do is find black pixels and even though the input image has a white pixel, its neighbors are not white.
Definition at line 44 of file vtkImageDifference.h.
Public Types | |
typedef vtkThreadedImageAlgorithm | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | SetImage (vtkDataObject *image) |
vtkImageData * | GetImage () |
double | GetError (void) |
void | GetError (double *e) |
double | GetThresholdedError (void) |
void | GetThresholdedError (double *e) |
virtual void | SetThreshold (int) |
virtual int | GetThreshold () |
virtual void | SetAllowShift (int) |
virtual int | GetAllowShift () |
virtual void | AllowShiftOn () |
virtual void | AllowShiftOff () |
virtual void | SetAveraging (int) |
virtual int | GetAveraging () |
virtual void | AveragingOn () |
virtual void | AveragingOff () |
Static Public Member Functions | |
static vtkImageDifference * | New () |
static int | IsTypeOf (const char *type) |
static vtkImageDifference * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkImageDifference () | |
~vtkImageDifference () | |
virtual int | RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual int | RequestUpdateExtent (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual void | ThreadedRequestData (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId) |
Protected Attributes | |
double | ErrorPerThread [VTK_MAX_THREADS] |
double | ThresholdedErrorPerThread [VTK_MAX_THREADS] |
int | AllowShift |
int | Threshold |
int | Averaging |
vtkImageDifference::vtkImageDifference | ( | ) | [protected] |
vtkImageDifference::~vtkImageDifference | ( | ) | [inline, protected] |
Definition at line 100 of file vtkImageDifference.h.
static vtkImageDifference* vtkImageDifference::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkAlgorithm.
virtual const char* vtkImageDifference::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkThreadedImageAlgorithm.
static int vtkImageDifference::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkThreadedImageAlgorithm.
virtual int vtkImageDifference::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkThreadedImageAlgorithm.
static vtkImageDifference* vtkImageDifference::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkThreadedImageAlgorithm.
void vtkImageDifference::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkThreadedImageAlgorithm.
void vtkImageDifference::SetImage | ( | vtkDataObject * | image | ) | [inline] |
Specify the Image to compare the input to.
Definition at line 53 of file vtkImageDifference.h.
vtkImageData* vtkImageDifference::GetImage | ( | ) |
Specify the Image to compare the input to.
double vtkImageDifference::GetError | ( | void | ) |
Return the total error in comparing the two images.
void vtkImageDifference::GetError | ( | double * | e | ) | [inline] |
Return the total error in comparing the two images.
Definition at line 60 of file vtkImageDifference.h.
double vtkImageDifference::GetThresholdedError | ( | void | ) |
Return the total thresholded error in comparing the two images. The thresholded error is the error for a given pixel minus the threshold and clamped at a minimum of zero.
void vtkImageDifference::GetThresholdedError | ( | double * | e | ) | [inline] |
Return the total thresholded error in comparing the two images. The thresholded error is the error for a given pixel minus the threshold and clamped at a minimum of zero.
Definition at line 68 of file vtkImageDifference.h.
virtual void vtkImageDifference::SetThreshold | ( | int | ) | [virtual] |
Specify a threshold tolerance for pixel differences.
virtual int vtkImageDifference::GetThreshold | ( | ) | [virtual] |
Specify a threshold tolerance for pixel differences.
virtual void vtkImageDifference::SetAllowShift | ( | int | ) | [virtual] |
Specify whether the comparison will allow a shift of one pixel between the images. If set, then the minimum difference between input images will be used to determine the difference. Otherwise, the difference is computed directly between pixels of identical row/column values.
virtual int vtkImageDifference::GetAllowShift | ( | ) | [virtual] |
Specify whether the comparison will allow a shift of one pixel between the images. If set, then the minimum difference between input images will be used to determine the difference. Otherwise, the difference is computed directly between pixels of identical row/column values.
virtual void vtkImageDifference::AllowShiftOn | ( | ) | [virtual] |
Specify whether the comparison will allow a shift of one pixel between the images. If set, then the minimum difference between input images will be used to determine the difference. Otherwise, the difference is computed directly between pixels of identical row/column values.
virtual void vtkImageDifference::AllowShiftOff | ( | ) | [virtual] |
Specify whether the comparison will allow a shift of one pixel between the images. If set, then the minimum difference between input images will be used to determine the difference. Otherwise, the difference is computed directly between pixels of identical row/column values.
virtual void vtkImageDifference::SetAveraging | ( | int | ) | [virtual] |
Specify whether the comparison will include comparison of averaged 3x3 data between the images. For graphics renderings you normally would leave this on. For imaging operations it should be off.
virtual int vtkImageDifference::GetAveraging | ( | ) | [virtual] |
Specify whether the comparison will include comparison of averaged 3x3 data between the images. For graphics renderings you normally would leave this on. For imaging operations it should be off.
virtual void vtkImageDifference::AveragingOn | ( | ) | [virtual] |
Specify whether the comparison will include comparison of averaged 3x3 data between the images. For graphics renderings you normally would leave this on. For imaging operations it should be off.
virtual void vtkImageDifference::AveragingOff | ( | ) | [virtual] |
Specify whether the comparison will include comparison of averaged 3x3 data between the images. For graphics renderings you normally would leave this on. For imaging operations it should be off.
virtual int vtkImageDifference::RequestInformation | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
Reimplemented from vtkImageAlgorithm.
virtual int vtkImageDifference::RequestUpdateExtent | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
Reimplemented from vtkImageAlgorithm.
virtual void vtkImageDifference::ThreadedRequestData | ( | vtkInformation * | request, | |
vtkInformationVector ** | inputVector, | |||
vtkInformationVector * | outputVector, | |||
vtkImageData *** | inData, | |||
vtkImageData ** | outData, | |||
int | extent[6], | |||
int | threadId | |||
) | [protected, virtual] |
If the subclass does not define an Execute method, then the task will be broken up, multiple threads will be spawned, and each thread will call this method. It is public so that the thread functions can call this method.
Reimplemented from vtkThreadedImageAlgorithm.
double vtkImageDifference::ErrorPerThread[VTK_MAX_THREADS] [protected] |
Definition at line 100 of file vtkImageDifference.h.
double vtkImageDifference::ThresholdedErrorPerThread[VTK_MAX_THREADS] [protected] |
Definition at line 103 of file vtkImageDifference.h.
int vtkImageDifference::AllowShift [protected] |
Definition at line 104 of file vtkImageDifference.h.
int vtkImageDifference::Threshold [protected] |
Definition at line 105 of file vtkImageDifference.h.
int vtkImageDifference::Averaging [protected] |
Definition at line 106 of file vtkImageDifference.h.