Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
MITK Testing

In this group, the API documentation of methods useful for testing is collected. The more general concepts of testing in MITK are described on the General: Tests in MITK page. More...

Macros

#define MITK_TEST_OUTPUT_NO_ENDL(x)
 Output some text without generating a terminating newline. Include. More...
 
#define MITK_TEST_OUTPUT(x)
 Output some text. More...
 
#define MITK_TEST_BEGIN(testName)
 Do some general test preparations. Must be called first in the main test function. More...
 
#define MITK_TEST_FAILED_MSG(MSG)
 Fail and finish test with message MSG. More...
 
#define MITK_TEST_END()
 Must be called last in the main test function. More...
 
#define MITK_TEST_FOR_EXCEPTION_BEGIN(EXCEPTIONCLASS)
 Begin block which should be checked for exceptions. More...
 
#define MITK_TEST_FOR_EXCEPTION(EXCEPTIONCLASS, STATEMENT)
 Simplified version of MITK_TEST_FOR_EXCEPTION_BEGIN / END for a single statement. More...
 
#define MITK_ASSERT_EQUAL(EXPECTED, ACTUAL, MSG)
 Testing macro to test if two objects are equal. More...
 
#define MITK_TEST_NOT_EQUAL(OBJ1, OBJ2, MSG)
 Testing macro to test if two objects are not equal. More...
 
#define MITK_ASSERT_NOT_EQUAL(OBJ1, OBJ2, MSG)
 Testing macro to test if two objects are not equal. More...
 
#define MITK_TEST_SUITE_REGISTRATION(TESTSUITE_NAME)
 Registers the given test suite. More...
 
#define MITK_TEST(TESTMETHOD)
 Adds a test to the current test suite. More...
 
#define MITK_PARAMETERIZED_TEST(TESTMETHOD, ARGS)
 Adds a parameterized test to the current test suite. More...
 
#define MITK_PARAMETERIZED_CMD_LINE_TEST(TESTMETHOD)
 Adds a parameterized test to the current test suite. More...
 
#define MITK_PARAMETERIZED_TEST_1(TESTMETHOD, arg1)
 Adds a parameterized test to the current test suite. More...
 
#define MITK_PARAMETERIZED_TEST_2(TESTMETHOD, arg1, arg2)
 Adds a parameterized test to the current test suite. More...
 

Functions

MITKCORE_EXPORT bool mitk::Equal (const mitk::BaseGeometry &leftHandSide, const mitk::BaseGeometry &rightHandSide, ScalarType coordinateEps, ScalarType directionEps, bool verbose=false)
 Equal A function comparing two geometries for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::BaseGeometry &leftHandSide, const mitk::BaseGeometry &rightHandSide, ScalarType eps=mitk::eps, bool verbose=false)
 Equal A function comparing two geometries for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::BaseGeometry::TransformType &leftHandSide, const mitk::BaseGeometry::TransformType &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two transforms (TransformType) for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::BaseGeometry::BoundingBoxType &leftHandSide, const mitk::BaseGeometry::BoundingBoxType &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two bounding boxes (BoundingBoxType) for being identical. More...
 
bool mitk::Equal (ScalarType scalar1, ScalarType scalar2, ScalarType eps=mitk::eps, bool verbose=false)
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::GeometryData &leftHandSide, const mitk::GeometryData &rightHandSide, mitk::ScalarType eps, bool verbose)
 Equal Compare two GeometryData objects for equality, returns true if found equal. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::Image &leftHandSide, const mitk::Image &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two images for being equal in meta- and imagedata. More...
 
template<typename TCoordRep , unsigned int NPointDimension>
bool mitk::Equal (const itk::Point< TCoordRep, NPointDimension > &point1, const itk::Point< TCoordRep, NPointDimension > &point2, TCoordRep eps=mitk::eps, bool verbose=false)
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::PointSet *leftHandSide, const mitk::PointSet *rightHandSide, mitk::ScalarType eps, bool verbose, bool checkGeometry=true)
 Equal A function comparing two pointsets for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::PointSet &leftHandSide, const mitk::PointSet &rightHandSide, mitk::ScalarType eps, bool verbose, bool checkGeometry=true)
 Equal A function comparing two pointsets for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::ProportionalTimeGeometry &leftHandSide, const mitk::ProportionalTimeGeometry &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two ProportionalTimeGeometries for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (mitk::Surface *leftHandSide, mitk::Surface *rightHandSide, mitk::ScalarType eps, bool verbose)
 Equal Compare two surfaces for equality, returns true if found equal. More...
 
MITKCORE_EXPORT bool mitk::Equal (mitk::Surface &leftHandSide, mitk::Surface &rightHandSide, mitk::ScalarType eps, bool verbose)
 Equal Compare two surfaces for equality, returns true if found equal. More...
 
MITKCORE_EXPORT bool mitk::Equal (vtkPolyData *leftHandSide, vtkPolyData *rightHandSide, mitk::ScalarType eps, bool verbose)
 Equal Compare two vtk PolyDatas for equality, returns true if found equal. More...
 
MITKCORE_EXPORT bool mitk::Equal (vtkPolyData &leftHandSide, vtkPolyData &rightHandSide, mitk::ScalarType eps, bool verbose)
 Equal Compare two vtk PolyDatas for equality, returns true if found equal. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::TimeGeometry &leftHandSide, const mitk::TimeGeometry &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two instances of TimeGeometry for being identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::TimeGeometry &leftHandSide, const mitk::TimeGeometry &rightHandSide, ScalarType coordinateEps, ScalarType directionEps, bool verbose)
 Compare two instances of TimeGeometry. More...
 
template<typename TCoordRep , unsigned int NPointDimension>
bool mitk::Equal (const itk::Vector< TCoordRep, NPointDimension > &vector1, const itk::Vector< TCoordRep, NPointDimension > &vector2, TCoordRep eps=mitk::eps, bool verbose=false)
 
bool mitk::Equal (const mitk::VnlVector &vector1, const mitk::VnlVector &vector2, ScalarType eps=mitk::eps, bool verbose=false)
 
template<typename TCoordRep , unsigned int NPointDimension>
bool mitk::Equal (const vnl_vector_fixed< TCoordRep, NPointDimension > &vector1, const vnl_vector_fixed< TCoordRep, NPointDimension > &vector2, TCoordRep eps=mitk::eps, bool verbose=false)
 
MITKMULTILABEL_EXPORT bool mitk::Equal (const mitk::Label &leftHandSide, const mitk::Label &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two labels for being equal in data. More...
 
MITKMULTILABEL_EXPORT bool mitk::Equal (const mitk::LabelSetImage &leftHandSide, const mitk::LabelSetImage &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two label set images for being equal in meta- and imagedata. More...
 
MITKMULTILABEL_EXPORT bool mitk::Equal (const mitk::LabelSetImage::ConstLabelVectorType &leftHandSide, const mitk::LabelSetImage::ConstLabelVectorType &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two vectors of labels for being equal in data. More...
 

Detailed Description

In this group, the API documentation of methods useful for testing is collected. The more general concepts of testing in MITK are described on the General: Tests in MITK page.

Macro Definition Documentation

◆ MITK_ASSERT_EQUAL

#define MITK_ASSERT_EQUAL (   EXPECTED,
  ACTUAL,
  MSG 
)

Testing macro to test if two objects are equal.

This macro uses mitk::eps and the corresponding mitk::Equal methods for all comparisons and will give verbose output on the dashboard/console. Feel free to implement mitk::Equal for your own datatype or purpose.

Parameters
EXPECTEDFirst object.
ACTUALSecond object.
MSGMessage to appear with the test.
Exceptions
ThrowsmitkException if a nullptr pointer is given as input.

Definition at line 211 of file mitkTestingMacros.h.

◆ MITK_ASSERT_NOT_EQUAL

#define MITK_ASSERT_NOT_EQUAL (   OBJ1,
  OBJ2,
  MSG 
)

Testing macro to test if two objects are not equal.

This macro uses mitk::eps and the corresponding mitk::Equal methods for all comparisons and will give verbose output on the dashboard/console.

Parameters
OBJ1First object.
OBJ2Second object.
MSGMessage to appear with the test.
Exceptions
ThrowsmitkException if a nullptr pointer is given as input.
See also
MITK_ASSERT_EQUAL

Definition at line 252 of file mitkTestingMacros.h.

◆ MITK_PARAMETERIZED_CMD_LINE_TEST

#define MITK_PARAMETERIZED_CMD_LINE_TEST (   TESTMETHOD)

Adds a parameterized test to the current test suite.

Use this macro after the CPPUNIT_TEST_SUITE() macro to add test cases which need parameters from the command line.

Warning
Use the macro MITK_PARAMETERIZED_CMD_LINE_TEST only if you know what you are doing. If you are not sure, use MITK_TEST instead. MITK_PARAMETERIZED_CMD_LINE_TEST is meant for migrating from ctest to CppUnit. If you implement new tests, the MITK_TEST macro will be sufficient.
Parameters
TESTMETHODThe name of the member function test.

Definition at line 339 of file mitkTestingMacros.h.

◆ MITK_PARAMETERIZED_TEST

#define MITK_PARAMETERIZED_TEST (   TESTMETHOD,
  ARGS 
)

Adds a parameterized test to the current test suite.

Use this macro after the CPPUNIT_TEST_SUITE() macro to add test cases which need custom parameters.

Parameters
TESTMETHODThe name of the member function test.
ARGSA std::vector<std::string> object containing test parameter.
Note
Use the macro MITK_PARAMETERIZED_TEST only if you know what you are doing. If you are not sure, use MITK_TEST instead.

Definition at line 311 of file mitkTestingMacros.h.

◆ MITK_PARAMETERIZED_TEST_1

#define MITK_PARAMETERIZED_TEST_1 (   TESTMETHOD,
  arg1 
)

Adds a parameterized test to the current test suite.

Use this macro after the CPPUNIT_TEST_SUITE() macro to add test cases which need one custom parameter.

Parameters
TESTMETHODThe name of the member function test.
arg1A custom string parameter being passed to the fixture.
Note
Use the macro MITK_PARAMETERIZED_TEST_1 only if you know what you are doing. If you are not sure, use MITK_TEST instead.
See also
MITK_PARAMETERIZED_TEST

Definition at line 359 of file mitkTestingMacros.h.

◆ MITK_PARAMETERIZED_TEST_2

#define MITK_PARAMETERIZED_TEST_2 (   TESTMETHOD,
  arg1,
  arg2 
)

Adds a parameterized test to the current test suite.

Use this macro after the CPPUNIT_TEST_SUITE() macro to add test cases which need two custom parameter.

Parameters
TESTMETHODThe name of the member function test.
arg1A custom string parameter being passed to the fixture.
arg2
Note
Use the macro MITK_PARAMETERIZED_TEST_2 only if you know what you are doing. If you are not sure, use MITK_TEST instead.
See also
MITK_PARAMETERIZED_TEST

Definition at line 384 of file mitkTestingMacros.h.

◆ MITK_TEST

#define MITK_TEST (   TESTMETHOD)

Adds a test to the current test suite.

Use this macro after the CPPUNIT_TEST_SUITE() macro to add test cases. The macro internally just calls the CPPUNIT_TEST macro.

Parameters
TESTMETHODThe name of the member function test.

Definition at line 295 of file mitkTestingMacros.h.

◆ MITK_TEST_BEGIN

#define MITK_TEST_BEGIN (   testName)

Do some general test preparations. Must be called first in the main test function.

Deprecated:
(as of 2013_09) Use MITK_TEST_SUITE_REGISTRATION instead.

Definition at line 60 of file mitkTestingMacros.h.

◆ MITK_TEST_END

#define MITK_TEST_END ( )

Must be called last in the main test function.

Deprecated:
(as of 2013_09) Use MITK_TEST_SUITE_REGISTRATION instead.

Definition at line 81 of file mitkTestingMacros.h.

◆ MITK_TEST_FAILED_MSG

#define MITK_TEST_FAILED_MSG (   MSG)

Fail and finish test with message MSG.

Deprecated:
(as of 2013_09) Use CPPUNIT_FAIL instead

Definition at line 71 of file mitkTestingMacros.h.

◆ MITK_TEST_FOR_EXCEPTION

#define MITK_TEST_FOR_EXCEPTION (   EXCEPTIONCLASS,
  STATEMENT 
)

Simplified version of MITK_TEST_FOR_EXCEPTION_BEGIN / END for a single statement.

Deprecated:
(as of 2013_09) Use CPPUNIT_ASSERT_THROW instead.

Definition at line 192 of file mitkTestingMacros.h.

◆ MITK_TEST_FOR_EXCEPTION_BEGIN

#define MITK_TEST_FOR_EXCEPTION_BEGIN (   EXCEPTIONCLASS)

Begin block which should be checked for exceptions.

Deprecated:
(as of 2013_09) Use CPPUNIT_ASSERT_THROW instead.

This macro, together with MITK_TEST_FOR_EXCEPTION_END, can be used to test whether a code block throws an expected exception. The test FAILS if the exception is NOT thrown. A simple example:

MITK_TEST_FOR_EXCEPTION_BEGIN(itk::ImageFileReaderException) typedef itk::ImageFileReader< itk::Image<unsigned char,2> > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName("/tmp/not-existing"); reader->Update(); MITK_TEST_FOR_EXCEPTION_END(itk::ImageFileReaderException)

Definition at line 169 of file mitkTestingMacros.h.

◆ MITK_TEST_NOT_EQUAL

#define MITK_TEST_NOT_EQUAL (   OBJ1,
  OBJ2,
  MSG 
)

Testing macro to test if two objects are not equal.

This macro uses mitk::eps and the corresponding mitk::Equal methods for all comparisons and will give verbose output on the dashboard/console.

Deprecated:
(as of 2013_09) Use MITK_ASSERT_NOT_EQUAL instead.
Parameters
OBJ1First object.
OBJ2Second object.
MSGMessage to appear with the test.
See also
MITK_TEST_EQUAL

Definition at line 234 of file mitkTestingMacros.h.

◆ MITK_TEST_OUTPUT

#define MITK_TEST_OUTPUT (   x)

Output some text.

Definition at line 51 of file mitkTestingMacros.h.

◆ MITK_TEST_OUTPUT_NO_ENDL

#define MITK_TEST_OUTPUT_NO_ENDL (   x)

Output some text without generating a terminating newline. Include.

Definition at line 44 of file mitkTestingMacros.h.

◆ MITK_TEST_SUITE_REGISTRATION

#define MITK_TEST_SUITE_REGISTRATION (   TESTSUITE_NAME)

Registers the given test suite.

Parameters
TESTSUITE_NAMEThe name of the test suite class, without "TestSuite" at the end.

Definition at line 267 of file mitkTestingMacros.h.

Function Documentation

◆ Equal() [1/23]

template<typename TCoordRep , unsigned int NPointDimension>
bool mitk::Equal ( const itk::Point< TCoordRep, NPointDimension > &  point1,
const itk::Point< TCoordRep, NPointDimension > &  point2,
TCoordRep  eps = mitk::eps,
bool  verbose = false 
)
inline
Parameters
point1Point to compare.
point2Point to compare.
epsTolerance for floating point comparison.
verboseFlag indicating detailed console output.
Returns
True if points are equal.

Definition at line 138 of file mitkPoint.h.

References mitk::ConditionalOutputOfDifference(), mitk::DifferenceBiggerOrEqualEps(), and mitk::eps.

◆ Equal() [2/23]

template<typename TCoordRep , unsigned int NPointDimension>
bool mitk::Equal ( const itk::Vector< TCoordRep, NPointDimension > &  vector1,
const itk::Vector< TCoordRep, NPointDimension > &  vector2,
TCoordRep  eps = mitk::eps,
bool  verbose = false 
)
inline
Parameters
vector1Vector to compare.
vector2Vector to compare.
epsTolerance for floating point comparison.
verboseFlag indicating detailed console output.
Returns
True if vectors are equal.

Definition at line 181 of file mitkVector.h.

References mitk::ConditionalOutputOfDifference(), mitk::DifferenceBiggerOrEqualEps(), and mitk::eps.

◆ Equal() [3/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::BaseGeometry leftHandSide,
const mitk::BaseGeometry rightHandSide,
ScalarType  coordinateEps,
ScalarType  directionEps,
bool  verbose = false 
)

Equal A function comparing two geometries for being identical.

The function compares the spacing, origin, axisvectors, extents, the matrix of the IndexToWorldTransform (elementwise), the bounding (elementwise) and the ImageGeometry flag.

The parameter eps is a tolarence value for all methods which are internally used for comparison. If you want to use different tolerance values for different parts of the geometry, feel free to use the other comparison methods and write your own implementation of Equal.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
coordinateEpsTolerance for comparison of all spatial aspects (spacing, origin and grid alignment). You can use mitk::eps in most cases.
directionEpsTolerance for comparison of all directional aspects (axis). You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparison are true. False in any other case.

◆ Equal() [4/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::BaseGeometry leftHandSide,
const mitk::BaseGeometry rightHandSide,
ScalarType  eps = mitk::eps,
bool  verbose = false 
)

Equal A function comparing two geometries for being identical.

This is an overloaded version that uses a single tolerance for spatial and directional aspects. For more details, see the other overloaded version.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparison are true. False in any other case.

◆ Equal() [5/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::BaseGeometry::BoundingBoxType leftHandSide,
const mitk::BaseGeometry::BoundingBoxType rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two bounding boxes (BoundingBoxType) for being identical.

The function compares the bounds (elementwise).

The parameter eps is a tolarence value for all methods which are internally used for comparison.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparison are true. False in any other case.

◆ Equal() [6/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::BaseGeometry::TransformType leftHandSide,
const mitk::BaseGeometry::TransformType rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two transforms (TransformType) for being identical.

The function compares the IndexToWorldTransform (elementwise).

The parameter eps is a tolarence value for all methods which are internally used for comparison.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparison are true. False in any other case.

◆ Equal() [7/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::GeometryData leftHandSide,
const mitk::GeometryData rightHandSide,
mitk::ScalarType  eps,
bool  verbose 
)

Equal Compare two GeometryData objects for equality, returns true if found equal.

Parameters
rightHandSideGeometryData to compare.
leftHandSideGeometryData to compare.
epsEpsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
verboseFlag indicating if the method should give a detailed console output.
Returns
True if every comparison is true, false in any other case.

◆ Equal() [8/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::Image leftHandSide,
const mitk::Image rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two images for being equal in meta- and imagedata.

Following aspects are tested for equality:

  • dimension of the images
  • size of the images
  • pixel type
  • pixel values : pixel values are expected to be identical at each position ( for other options see mitk::CompareImageFilter )
Parameters
rightHandSideAn image to be compared
leftHandSideAn image to be compared
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
true, if all subsequent comparisons are true, false otherwise

◆ Equal() [9/23]

MITKMULTILABEL_EXPORT bool mitk::Equal ( const mitk::Label leftHandSide,
const mitk::Label rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two labels for being equal in data.

Following aspects are tested for equality:

  • Lebel equality via Equal-PropetyList
Parameters
rightHandSideAn image to be compared
leftHandSideAn image to be compared
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
true, if all subsequent comparisons are true, false otherwise

◆ Equal() [10/23]

MITKMULTILABEL_EXPORT bool mitk::Equal ( const mitk::LabelSetImage leftHandSide,
const mitk::LabelSetImage rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two label set images for being equal in meta- and imagedata.

Following aspects are tested for equality:

  • LabelSetImage members
  • working image data
  • layer image data
  • labels in label set
Parameters
rightHandSideAn image to be compared
leftHandSideAn image to be compared
epsTolerance for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
true, if all subsequent comparisons are true, false otherwise

◆ Equal() [11/23]

MITKMULTILABEL_EXPORT bool mitk::Equal ( const mitk::LabelSetImage::ConstLabelVectorType leftHandSide,
const mitk::LabelSetImage::ConstLabelVectorType rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two vectors of labels for being equal in data.

Following aspects are tested for equality:

  • Labels in vector
Parameters
rightHandSideAn vector of labels to be compared
leftHandSideAn vector of labels to be compared
epsTolerance for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
true, if all subsequent comparisons are true, false otherwise

◆ Equal() [12/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::PointSet leftHandSide,
const mitk::PointSet rightHandSide,
mitk::ScalarType  eps,
bool  verbose,
bool  checkGeometry = true 
)

Equal A function comparing two pointsets for being identical.

The function compares the Geometry, the size and all points element-wise. The parameter eps is a tolarence value for all methods which are internally used for comparison.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
checkGeometryif comparing point sets loaded from a file, the geometries might be different and must not be compared. In all other cases, you should compare the geometries.
Returns
True, if all subsequent comparisons are true, false otherwise

◆ Equal() [13/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::PointSet leftHandSide,
const mitk::PointSet rightHandSide,
mitk::ScalarType  eps,
bool  verbose,
bool  checkGeometry = true 
)

Equal A function comparing two pointsets for being identical.

Warning
This method is deprecated and will not be available in the future. Use the bool mitk::Equal(const mitk::PointSet& p1, const mitk::PointSet& p2) instead.

The function compares the Geometry, the size and all points element-wise. The parameter eps is a tolarence value for all methods which are internally used for comparison.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolarence for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
checkGeometryif comparing point sets loaded from a file, the geometries might be different and must not be compared. In all other cases, you should compare the geometries.
Returns
True, if all subsequent comparisons are true, false otherwise

◆ Equal() [14/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::ProportionalTimeGeometry leftHandSide,
const mitk::ProportionalTimeGeometry rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two ProportionalTimeGeometries for being identical.

The function compares two instances of ProportionalTimeGeometries in all their aspects.

The parameter eps is a tolerance value for all methods which are internally used for comparison. If you want to use different tolerance values for different parts of the geometry, feel free to use the other comparison methods and write your own implementation of Equal.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolerance for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparison are true. False in any other case.

◆ Equal() [15/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::TimeGeometry leftHandSide,
const mitk::TimeGeometry rightHandSide,
ScalarType  coordinateEps,
ScalarType  directionEps,
bool  verbose 
)

Compare two instances of TimeGeometry.

The function compares two instances of TimeGeometries in all their aspects.

The parameter eps is a tolerance value for all methods which are internally used for comparison. If you want to use different tolerance values for different parts of the geometry, feel free to use the other comparison methods and write your own implementation of Equal.

Parameters
leftHandSideCompare this against rightHandSide.
rightHandSideCompare this against leftHandSide.
coordinateEpsTolerance for comparison of all spatial and temporal aspects (spacing, origin and grid alignment, time points). You can use mitk::eps in most cases.
directionEpsTolerance for comparison of all directional aspects (axis). You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparisons are true. False in any other case.

◆ Equal() [16/23]

MITKCORE_EXPORT bool mitk::Equal ( const mitk::TimeGeometry leftHandSide,
const mitk::TimeGeometry rightHandSide,
ScalarType  eps,
bool  verbose 
)

Equal A function comparing two instances of TimeGeometry for being identical.

The function compares two instances of TimeGeometries in all their aspects.

The parameter eps is a tolerance value for all methods which are internally used for comparison. If you want to use different tolerance values for different parts of the geometry, feel free to use the other comparison methods and write your own implementation of Equal.

Parameters
rightHandSideCompare this against leftHandSide.
leftHandSideCompare this against rightHandSide.
epsTolerance for comparison. You can use mitk::eps in most cases.
verboseFlag indicating if the user wants detailed console output or not.
Returns
True, if all comparison are true. False in any other case.

◆ Equal() [17/23]

bool mitk::Equal ( const mitk::VnlVector vector1,
const mitk::VnlVector vector2,
ScalarType  eps = mitk::eps,
bool  verbose = false 
)
inline
Parameters
vector1Vector to compare.
vector2Vector to compare.
epsTolerance for floating point comparison.
verboseFlag indicating detailed console output.
Returns
True if vectors are equal.

Definition at line 211 of file mitkVector.h.

References mitk::ConditionalOutputOfDifference(), mitk::DifferenceBiggerOrEqualEps(), and mitk::eps.

◆ Equal() [18/23]

template<typename TCoordRep , unsigned int NPointDimension>
bool mitk::Equal ( const vnl_vector_fixed< TCoordRep, NPointDimension > &  vector1,
const vnl_vector_fixed< TCoordRep, NPointDimension > &  vector2,
TCoordRep  eps = mitk::eps,
bool  verbose = false 
)
inline
Parameters
vector1Vector to compare.
vector2Vector to compare.
epsTolerance for floating point comparison.
verboseFlag indicating detailed console output.
Returns
True if vectors are equal.

Definition at line 242 of file mitkVector.h.

References mitk::ConditionalOutputOfDifference(), mitk::DifferenceBiggerOrEqualEps(), and mitk::eps.

◆ Equal() [19/23]

MITKCORE_EXPORT bool mitk::Equal ( mitk::Surface leftHandSide,
mitk::Surface rightHandSide,
mitk::ScalarType  eps,
bool  verbose 
)

Equal Compare two surfaces for equality, returns true if found equal.

Parameters
rightHandSideSurface to compare.
leftHandSideSurface to compare.
epsEpsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
verboseFlag indicating if the method should give a detailed console output.
Returns
True if every comparison is true, false in any other case.

◆ Equal() [20/23]

MITKCORE_EXPORT bool mitk::Equal ( mitk::Surface leftHandSide,
mitk::Surface rightHandSide,
mitk::ScalarType  eps,
bool  verbose 
)

Equal Compare two surfaces for equality, returns true if found equal.

Warning
This method is deprecated and will not be available in the future. Use the bool mitk::Equal(const mitk::Surface& s1, const mitk::Surface& s2) instead
Parameters
rightHandSideSurface to compare.
leftHandSideSurface to compare.
epsEpsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
verboseFlag indicating if the method should give a detailed console output.
Returns
True if every comparison is true, false in any other case.

◆ Equal() [21/23]

bool mitk::Equal ( ScalarType  scalar1,
ScalarType  scalar2,
ScalarType  eps = mitk::eps,
bool  verbose = false 
)
inline
Parameters
scalar1Scalar value to compare.
scalar2Scalar value to compare.
epsTolerance for floating point comparison.
verboseFlag indicating detailed console output.
Returns
True if scalars are equal.

Definition at line 68 of file mitkEqual.h.

References mitk::ConditionalOutputOfDifference(), mitk::DifferenceBiggerOrEqualEps(), and mitk::eps.

◆ Equal() [22/23]

MITKCORE_EXPORT bool mitk::Equal ( vtkPolyData &  leftHandSide,
vtkPolyData &  rightHandSide,
mitk::ScalarType  eps,
bool  verbose 
)

Equal Compare two vtk PolyDatas for equality, returns true if found equal.

Parameters
rightHandSideSurface to compare.
leftHandSideSurface to compare.
epsEpsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
verboseFlag indicating if the method should give a detailed console output.
Returns
True if every comparison is true, false in any other case.

This will only check if the number of cells, vertices, polygons, stripes and lines is the same and whether all the two poly datas have the same number of points with the same coordinates. It is not checked whether all points are correctly connected.

◆ Equal() [23/23]

MITKCORE_EXPORT bool mitk::Equal ( vtkPolyData *  leftHandSide,
vtkPolyData *  rightHandSide,
mitk::ScalarType  eps,
bool  verbose 
)

Equal Compare two vtk PolyDatas for equality, returns true if found equal.

Warning
This method is deprecated and will not be available in the future. Use the bool mitk::Equal(const vtkPolyData& p1, const vtkPolyData& p2) instead
Parameters
rightHandSideSurface to compare.
leftHandSideSurface to compare.
epsEpsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
verboseFlag indicating if the method should give a detailed console output.
Returns
True if every comparison is true, false in any other case.

This will only check if the number of cells, vertices, polygons, stripes and lines is the same and whether all the two poly datas have the same number of points with the same coordinates. It is not checked whether all points are correctly connected.