Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
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 eps, bool verbose)
 Equal A function comparing two geometries for beeing identical. More...
 
MITKCORE_EXPORT bool mitk::Equal (const mitk::BaseGeometry &leftHandSide, const mitk::BaseGeometry &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two geometries for beeing 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 beeing 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 beeing 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 beeing 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 beeing 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 beeing equal in meta- and imagedata. 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 beeing 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 beeing 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 beeing 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...
 
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)
 
MITKIGTBASE_EXPORT bool mitk::Equal (const mitk::NavigationData &leftHandSide, const mitk::NavigationData &rightHandSide, ScalarType eps=mitk::eps, bool verbose=false)
 Equal A function comparing two navigation data objects for beeing equal in meta- and imagedata. More...
 
MITKMULTILABEL_EXPORT bool mitk::Equal (const mitk::Label &leftHandSide, const mitk::Label &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two labels for beeing equal in data. More...
 
MITKMULTILABEL_EXPORT bool mitk::Equal (const mitk::LabelSet &leftHandSide, const mitk::LabelSet &rightHandSide, ScalarType eps, bool verbose)
 Equal A function comparing two label sets for beeing 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 beeing equal in meta- and imagedata. More...
 
MITKOPENIGTLINK_EXPORT bool mitk::Equal (const mitk::IGTLMessage &leftHandSide, const mitk::IGTLMessage &rightHandSide, ScalarType eps=mitk::eps, bool verbose=false)
 Equal A function comparing two OpenIGTLink message objects for being equal in meta- and imagedata. 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.

Referenced by Assert_ItkVectorImageImportAndCast_ReturnsTrue(), GetEmptyTestImageWithGeometry(), mitkSurfaceToSurfaceFilterTest(), and TestRandomPixelAccess().

◆ 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.
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 383 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 funtion test.

Definition at line 295 of file mitkTestingMacros.h.

Referenced by CompareSurfacePointPositions(), createTextAnnotationWithLayouter(), FreeFunction(), GenerateGradientWithDimXImage(), GetEmptyTestImageWithGeometry(), and testDeserializeFunction().

◆ 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

◆ MITK_TEST_FOR_EXCEPTION

#define MITK_TEST_FOR_EXCEPTION (   EXCEPTIONCLASS,
  STATEMENT 
)

◆ 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.

Referenced by mitkImageAccessorTest(), TestDataStorage(), and TestRandomPixelAccess().

◆ 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

◆ 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.

Referenced by mitkSceneIOTest().

◆ 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/27]

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.

Definition at line 58 of file mitkGeometryData.cpp.

References mitk::TimeGeometry::CountTimeSteps(), mitk::Equal(), mitk::BaseData::GetGeometry(), mitk::BaseData::GetTimeGeometry(), and MITK_INFO.

◆ Equal() [2/27]

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 74 of file mitkEqual.h.

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

◆ Equal() [3/27]

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.

Definition at line 468 of file mitkSurface.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [4/27]

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.

Definition at line 479 of file mitkSurface.cpp.

References mitk::eps, mitk::Equal(), mitk::Surface::GetSizeOfPolyDataSeries(), mitk::Surface::GetVtkPolyData(), MITK_INFO, and verbose().

◆ Equal() [5/27]

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

Equal A function comparing two labels for beeing 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

Definition at line 260 of file mitkLabel.cpp.

References mitk::PropertyList::GetMap(), and MITK_INFO.

◆ Equal() [6/27]

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 112 of file mitkPoint.h.

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

◆ Equal() [7/27]

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.

Definition at line 368 of file mitkSurface.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [8/27]

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.

Definition at line 379 of file mitkSurface.cpp.

References mitk::eps, mitk::Equal(), MITK_INFO, and verbose().

◆ Equal() [9/27]

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 148 of file mitkVector.h.

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

◆ Equal() [10/27]

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 178 of file mitkVector.h.

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

◆ Equal() [11/27]

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

Equal A function comparing two OpenIGTLink message objects for being equal in meta- and imagedata.

Following aspects are tested for equality:

  • TBD
Parameters
rightHandSideAn IGTLMessage to be compared
leftHandSideAn IGTLMessage 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

Definition at line 135 of file mitkIGTLMessage.cpp.

References mitk::IGTLMessage::GetIGTTimeStamp(), mitk::IGTLMessage::GetName(), and MITK_INFO.

◆ Equal() [12/27]

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 209 of file mitkVector.h.

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

◆ Equal() [13/27]

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

Equal A function comparing two label sets for beeing equal in data.

Following aspects are tested for equality:

  • LabelSetmembers
  • Label container (map)
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

Definition at line 292 of file mitkLabelSet.cpp.

References mitk::eps, mitk::Equal(), mitk::LabelSet::GetActiveLabel(), mitk::LabelSet::GetLayer(), mitk::LabelSet::GetNumberOfLabels(), mitk::LabelSet::IteratorConstBegin(), mitk::LabelSet::IteratorConstEnd(), MITK_INFO, and verbose().

◆ Equal() [14/27]

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.

Definition at line 277 of file mitkProportionalTimeGeometry.cpp.

References mitk::Equal().

◆ Equal() [15/27]

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

Equal A function comparing two navigation data objects for beeing equal in meta- and imagedata.

Following aspects are tested for equality:

  • position
  • orientation
  • other members and flags of the class
Parameters
rightHandSideAn NavigationData to be compared
leftHandSideAn NavigationData 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

Definition at line 319 of file mitkNavigationData.cpp.

References mitk::eps, mitk::Equal(), mitk::NavigationData::GetCovErrorMatrix(), mitk::NavigationData::GetIGTTimeStamp(), mitk::NavigationData::GetName(), mitk::NavigationData::GetOrientation(), mitk::NavigationData::GetPosition(), and MITK_INFO.

◆ Equal() [16/27]

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.

Definition at line 192 of file mitkTimeGeometry.cpp.

References mitk::TimeGeometry::CountTimeSteps(), mitk::eps, mitk::Equal(), mitk::TimeGeometry::GetBoundingBoxInWorld(), mitk::TimeGeometry::GetBoundsInWorld(), mitk::TimeGeometry::GetGeometryForTimeStep(), mitk::TimeGeometry::GetMaximumTimePoint(), mitk::TimeGeometry::GetMinimumTimePoint(), MITK_INFO, mitk::TimeGeometry::TimeStepToTimePoint(), and verbose().

◆ Equal() [17/27]

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 beeing 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 comparion.

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

Definition at line 882 of file mitkPointSet.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [18/27]

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

Equal A function comparing two label set images for beeing 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

Definition at line 910 of file mitkLabelSetImage.cpp.

References mitk::eps, mitk::Equal(), mitk::LabelSetImage::GetActiveLayer(), mitk::Image::GetDimension(), mitk::LabelSetImage::GetLabelSet(), mitk::LabelSetImage::GetLayerImage(), mitk::LabelSetImage::GetNumberOfLayers(), mitk::LabelSetImage::GetTotalNumberOfLabels(), MITK_INFO, and verbose().

◆ Equal() [19/27]

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 beeing 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 comparion.

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

Definition at line 897 of file mitkPointSet.cpp.

References mitk::PointSet::Begin(), mitk::PointSet::End(), mitk::eps, mitk::Equal(), mitk::BaseData::GetGeometry(), mitk::PointSet::GetSize(), MITK_INFO, and verbose().

◆ Equal() [20/27]

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

Equal A function comparing two geometries for beeing identical.

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

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 comparion. If you want to use different tolarance 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.
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.

Definition at line 863 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [21/27]

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

Equal A function comparing two geometries for beeing 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 comparion. If you want to use different tolarance 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.
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.

Definition at line 877 of file mitkBaseGeometry.cpp.

References mitk::eps, mitk::Equal(), mitk::BaseGeometry::GetAxisVector(), mitk::BaseGeometry::GetBoundingBox(), mitk::BaseGeometry::GetExtent(), mitk::BaseGeometry::GetFrameOfReferenceID(), mitk::BaseGeometry::GetImageGeometry(), mitk::BaseGeometry::GetIndexToWorldTransform(), mitk::BaseGeometry::GetOrigin(), mitk::BaseGeometry::GetSpacing(), MITK_INFO, and verbose().

◆ Equal() [22/27]

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 beeing identical.

Warning
This method is deprecated and will not be available in the future. Use the bool mitk::Equal(const mitk::mitk::BaseGeometry::TransformType& t1, const mitk::BaseGeometry::TransformType& t2) instead.

The function compares the IndexToWorldTransform (elementwise).

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

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.

Definition at line 972 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [23/27]

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 beeing identical.

The function compares the IndexToWorldTransform (elementwise).

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

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.

Definition at line 986 of file mitkBaseGeometry.cpp.

References mitk::eps, mitk::MatrixEqualElementWise(), and MITK_INFO.

◆ Equal() [24/27]

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 beeing identical.

Warning
This method is deprecated and will not be available in the future. Use the bool mitk::Equal(const mitk::mitk::BaseGeometry::BoundingBoxType& b1, const mitk::BaseGeometry::BoundingBoxType& b2) instead.

The function compares the bounds (elementwise).

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

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.

Definition at line 821 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [25/27]

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 beeing identical.

The function compares the bounds (elementwise).

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

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.

Definition at line 836 of file mitkBaseGeometry.cpp.

References mitk::eps, mitk::Equal(), and MITK_INFO.

◆ Equal() [26/27]

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

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

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

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

Definition at line 1457 of file mitkImage.cpp.

References mitk::Equal(), and MITK_ERROR.

◆ Equal() [27/27]

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

Equal A function comparing two images for beeing 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

Definition at line 1468 of file mitkImage.cpp.

References mitk::eps, mitk::Equal(), mitk::Image::GetDimension(), mitk::BaseData::GetGeometry(), mitk::Image::GetPixelType(), mitk::PixelType::GetTypeAsString(), min(), MITK_INFO, mitk::ImageToImageFilter::New(), and verbose().