Medical Imaging Interaction Toolkit  2016.11.0
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_TEST_EQUAL(OBJ1, OBJ2, MSG)
 Testing macro to test if two objects are equal. 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

#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 NULL pointer is given as input.

Definition at line 232 of file mitkTestingMacros.h.

Referenced by Assert_ItkVectorImageImportAndCast_ReturnsTrue(), and mitkSurfaceToSurfaceFilterTest().

#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 NULL pointer is given as input.
See also
MITK_ASSERT_EQUAL

Definition at line 273 of file mitkTestingMacros.h.

#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 350 of file mitkTestingMacros.h.

#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 322 of file mitkTestingMacros.h.

#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 370 of file mitkTestingMacros.h.

#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 394 of file mitkTestingMacros.h.

#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 306 of file mitkTestingMacros.h.

#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 63 of file mitkTestingMacros.h.

#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 84 of file mitkTestingMacros.h.

#define MITK_TEST_EQUAL (   OBJ1,
  OBJ2,
  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.

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

Definition at line 215 of file mitkTestingMacros.h.

#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 195 of file mitkTestingMacros.h.

Referenced by mitkSurfaceToSurfaceFilterTest(), mitkTrackingDeviceSourceTest(), and TestDataStorage().

#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 172 of file mitkTestingMacros.h.

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

#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 255 of file mitkTestingMacros.h.

#define MITK_TEST_OUTPUT_NO_ENDL (   x)

Output some text without generating a terminating newline. Include.

Definition at line 47 of file mitkTestingMacros.h.

Referenced by mitkSceneIOTest().

#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 288 of file mitkTestingMacros.h.

Function Documentation

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

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

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 62 of file mitkGeometryData.cpp.

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

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 472 of file mitkSurface.cpp.

References mitk::Equal(), and MITK_ERROR.

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 483 of file mitkSurface.cpp.

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

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 262 of file mitkLabel.cpp.

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

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

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

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 372 of file mitkSurface.cpp.

References mitk::Equal(), and MITK_ERROR.

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 383 of file mitkSurface.cpp.

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

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

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

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

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

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 130 of file mitkIGTLMessage.cpp.

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

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

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

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 266 of file mitkLabelSet.cpp.

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

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 280 of file mitkProportionalTimeGeometry.cpp.

References mitk::Equal().

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

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 196 of file mitkTimeGeometry.cpp.

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

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 886 of file mitkPointSet.cpp.

References mitk::Equal(), and MITK_ERROR.

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 886 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(), and MITK_INFO.

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 901 of file mitkPointSet.cpp.

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

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 867 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_ERROR.

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 881 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(), and MITK_INFO.

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 976 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_ERROR.

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 990 of file mitkBaseGeometry.cpp.

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

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 825 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_ERROR.

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 840 of file mitkBaseGeometry.cpp.

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

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 1456 of file mitkImage.cpp.

References mitk::Equal(), and MITK_ERROR.

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 1467 of file mitkImage.cpp.

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