Esempio n. 1
0
    void PointSetCompare(mitk::PointSet::Pointer pointSet2,
                         mitk::PointSet::Pointer pointSet1, bool& /*identical*/)
    {
        MITK_TEST_CONDITION(pointSet1->GetSize() == pointSet2->GetSize(), "Testing if PointSet size is correct" );

        for (unsigned int t = 0; t < numberOfTimeSeries; t++)
        {
            for (unsigned int i = 0; i < (unsigned int) pointSet1->GetSize(t); ++i)
            {
                mitk::Point3D p1 = pointSet1->GetPoint(i);
                mitk::Point3D p2 = pointSet2->GetPoint(i);

                //test
                std::cout << "r point: " << p2 << std::endl;
                std::cout << "w point: " << p1 << std::endl;

                //test end

                MITK_TEST_CONDITION((p1[0] - p2[0]) <= 0.0001, "Testing if X coordinates of the Point are at the same Position" );
                MITK_TEST_CONDITION((p1[1] - p2[1]) <= 0.0001, "Testing if Y coordinates of the Point are at the same Position" );
                MITK_TEST_CONDITION((p1[2] - p2[2]) <= 0.0001, "Testing if Z coordinates of the Point are at the same Position" );

            }
        }

        // testing geometry
        MITK_TEST_CONDITION( mitk::Equal( *(pointSet1->GetGeometry()), *(pointSet2->GetGeometry()), 0.000001, true),
                             "Restored geometry must equal original one.");
    }
Esempio n. 2
0
  void Equal_DifferentGeometries_ReturnsFalse()
  {
    mitk::Point3D origin;
    origin[0] = 0.0;
    origin[1] = 0.0;
    origin[2] = 1.0 + 2*mitk::eps;
    m_AnotherPointSet->GetGeometry()->SetOrigin(origin);

    MITK_ASSERT_NOT_EQUAL( m_PointSet, m_AnotherPointSet, "Origin was modified. Result should be false.");
  }