Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Interface to compare two BaseData objects for (near) equality. More...
#include <mitkBaseDataCompare.h>
Public Member Functions | |
bool | AreEqual (const BaseData *left, const BaseData *right, ScalarType eps=mitk::eps, bool verbose=false) |
Main interface method, compares two given BaseData instances. More... | |
Static Public Member Functions | |
static void | RegisterCoreEquals () |
Register core type comparators that come with mitk::Equal() functions. More... | |
Interface to compare two BaseData objects for (near) equality.
Classes implementing this interface must be able to judge two given instances of a certain BaseData type as equal or not.
The definition of "equal" is left to individual classes! (original use case being the comparison of BaseData objects after serialization)
This interface is used by DataStorageCompare to compare two given BaseData instances. The interface is required to handle all data types in an identical way (alternatives: operator== is too strict; mitk::Equal() has different signatures).
To re-use what already has been implemented in various mitk::Equal() functions, this interface is accompanied by a template class BaseDataCompareT which makes use of an existing mitk::Equal() method.
Definition at line 48 of file mitkBaseDataCompare.h.
bool mitk::BaseDataCompare::AreEqual | ( | const BaseData * | left, |
const BaseData * | right, | ||
ScalarType | eps = mitk::eps , |
||
bool | verbose = false |
||
) |
Main interface method, compares two given BaseData instances.
Compares left and right BaseData instance using a given epsilon/precision for potential float value comparisons. Can print warnings when the verbose flag is given.
left | left BaseData instance of the comparison. |
right | right BaseData instance of the comparison. |
eps | precision for float value comparisons. |
verbose | when true, failing comparisons will print messages to logging/console. |
Definition at line 29 of file mitkBaseDataCompare.cpp.
|
static |
Register core type comparators that come with mitk::Equal() functions.
Definition at line 76 of file mitkBaseDataCompare.cpp.
References us::GetModuleContext(), mitk::GeometryData::GetStaticNameOfClass(), mitk::Surface::GetStaticNameOfClass(), mitk::PointSet::GetStaticNameOfClass(), mitk::Image::GetStaticNameOfClass(), and ModuleContext::RegisterService().
Referenced by mitk::DataStorageCompare::DataStorageCompare().