31 template <
typename DifferenceType>
34 return std::fabs(diff) >= epsilon;
49 template <
typename ElementToOutput1,
typename ElementToOutput2>
51 ElementToOutput1 elem1, ElementToOutput2 elem2,
mitk::ScalarType eps,
bool verbose,
bool isEqual)
53 if (verbose && !isEqual)
55 MITK_INFO <<
typeid(ElementToOutput1).name() <<
" and " <<
typeid(ElementToOutput2).name()
56 <<
" not equal. Lefthandside " << std::setprecision(12) << elem1 <<
" - Righthandside " << elem2
57 <<
" - epsilon " <<
eps;
#define MITK_INFO
Log an informational message.
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
Epsilon value for floating point comparison (vnl_math::eps * 100).
void ConditionalOutputOfDifference(ElementToOutput1 elem1, ElementToOutput2 elem2, mitk::ScalarType eps, bool verbose, bool isEqual)
Conditionally output the difference between two elements to the log.
bool DifferenceBiggerOrEqualEps(DifferenceType diff, mitk::ScalarType epsilon=mitk::eps)
Check if the absolute difference is bigger than or equal to a given epsilon.
double ScalarType
Scalar type used throughout MITK for geometric computations.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.