示例#1
0
  void Equal_DifferentBoundingBox_ReturnsFalse()
  {
    //create different bounds to make the comparison false
    mitk::ScalarType bounds[ ] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
    m_AnotherGeometry3D->SetBounds(bounds);

    MITK_ASSERT_NOT_EQUAL( m_Geometry3D, m_AnotherGeometry3D, "Bounds are different. Result should be false.");
  }
示例#2
0
  void Equal_DifferentPoints_ReturnsFalse()
  {
    mitk::Surface::Pointer surfaceWithADifferentPoint = m_Surface3D->Clone();
    //modify points. m_Surface3D contains m_PointsOne
    surfaceWithADifferentPoint->GetVtkPolyData()->SetPoints( m_PointsTwo );

    MITK_ASSERT_NOT_EQUAL( m_Surface3D, surfaceWithADifferentPoint, "A surface with a single timestep and different points should not be equal.");
  }
示例#3
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.");
  }
示例#4
0
  void Equal_DifferentSpacing_ReturnsFalse()
  {
    mitk::Vector3D differentSpacing;
    differentSpacing[0] = 1.0;
    differentSpacing[1] = 1.0 + 2*mitk::eps;
    differentSpacing[2] = 1.0;

    m_AnotherGeometry3D->SetSpacing(differentSpacing);

    MITK_ASSERT_NOT_EQUAL( m_Geometry3D, m_AnotherGeometry3D, "Spacing was modified. Result should be false.");
  }
示例#5
0
  void Equal_TwoTimeStepsDifferentPoints_ReturnsFalse()
  {
    vtkSmartPointer<vtkPolyData> polyDataDifferentPoints = vtkSmartPointer<vtkPolyData>::New();
    polyDataDifferentPoints->SetPoints(m_PointsTwo);
    polyDataDifferentPoints->SetPolys(m_PolygonArrayTwo);

    mitk::Surface::Pointer surface3DTwoTimeStepsDifferentPoints = mitk::Surface::New();
    surface3DTwoTimeStepsDifferentPoints->SetVtkPolyData( m_PolyDataOne, 0 );
    surface3DTwoTimeStepsDifferentPoints->SetVtkPolyData( polyDataDifferentPoints, 1 );

    //The geometry also changes, because the second pointset has a different geometry/extent.
    MITK_ASSERT_NOT_EQUAL( surface3DTwoTimeStepsDifferentPoints, m_Surface3DTwoTimeSteps, "A surface with the same timesteps and different points should not be equal.");
  }
示例#6
0
  void Equal_DifferentPoints_ReturnsFalse()
  {
    mitk::Point3D tmpPoint;
    tmpPoint[0] = 1.0;
    tmpPoint[1] = 1.0;
    tmpPoint[2] = 1.0;

    m_PointSet->InsertPoint( 1, tmpPoint );

    tmpPoint[0] = 1.0 + 2*mitk::eps;
    m_AnotherPointSet->InsertPoint( 1, tmpPoint );

    MITK_ASSERT_NOT_EQUAL( m_PointSet, m_AnotherPointSet, "Two pointsets with different points. Result should be false.");
  }
示例#7
0
  void Equal_DifferentNumberOfPoints_ReturnsFalse()
  {
    mitk::Point3D tmpPoint;
    tmpPoint[0] = 1.0;
    tmpPoint[1] = 1.0;
    tmpPoint[2] = 1.0;

    m_PointSet->InsertPoint( 1, tmpPoint );
    m_PointSet->InsertPoint( 2, tmpPoint );

    m_AnotherPointSet->InsertPoint( 1, tmpPoint );

    MITK_ASSERT_NOT_EQUAL( m_PointSet, m_AnotherPointSet, "One pointset has two points the other has one. Result should be false.");
  }
示例#8
0
  void Equal_DifferentIndexToWorldTransform_ReturnsFalse()
  {
    //Create another index to world transform and make it different somehow
    mitk::AffineTransform3D::Pointer differentIndexToWorldTransform = mitk::AffineTransform3D::New();

    mitk::AffineTransform3D::MatrixType differentMatrix;
    differentMatrix.SetIdentity();
    differentMatrix(1,1) = 2;

    differentIndexToWorldTransform->SetMatrix( differentMatrix );
    m_AnotherGeometry3D->SetIndexToWorldTransform(differentIndexToWorldTransform);

    MITK_ASSERT_NOT_EQUAL( m_Geometry3D, m_AnotherGeometry3D, "IndexToWorldTransform was modified. Result should be false.");
  }
示例#9
0
  void Equal_SurfaceWithPolygonSurfaceWithPolyLine_ReturnsFalse()
  {
    //generate a line
    vtkSmartPointer<vtkPolyLine> polyLineOne = vtkSmartPointer<vtkPolyLine>::New();
    polyLineOne->GetPointIds()->SetNumberOfIds(2);
    polyLineOne->GetPointIds()->SetId(0,0);
    polyLineOne->GetPointIds()->SetId(1,1);

    vtkSmartPointer<vtkCellArray> polyLineArrayOne = vtkSmartPointer<vtkCellArray>::New();
    polyLineArrayOne->InsertNextCell(polyLineOne);

    vtkSmartPointer<vtkPolyData> polyDataLine = vtkSmartPointer<vtkPolyData>::New();
    polyDataLine->SetPoints(m_PointsOne);
    polyDataLine->SetLines(polyLineArrayOne);

    mitk::Surface::Pointer surface3DLine = mitk::Surface::New();
    surface3DLine->SetVtkPolyData( polyDataLine );

    MITK_ASSERT_NOT_EQUAL( m_Surface3D, surface3DLine, "A surface with the same timesteps and points and the same number of cells, but different types of cells should not be equal.");
  }
示例#10
0
 void Equal_OneTimeStepVSTwoTimeStep_ReturnsFalse()
 {
   MITK_ASSERT_NOT_EQUAL( m_Surface3D, m_Surface3DTwoTimeSteps, "A one timestep and two timestep surface should not be equal.");
 }
示例#11
0
 void Equal_InputIsNull_ReturnsFalse()
 {
   mitk::PointSet::Pointer pointSet = NULL;
   MITK_ASSERT_NOT_EQUAL( pointSet, pointSet, "Input is NULL. Result should be false.");
 }
示例#12
0
  void Equal_DifferentImageGeometry_ReturnsFalse()
  {
    m_AnotherGeometry3D->SetImageGeometry(true);

    MITK_ASSERT_NOT_EQUAL( m_Geometry3D, m_AnotherGeometry3D, "One Geometry is image, the other is not. Result should be false.");
  }
示例#13
0
 void Equal_InputIsNull_ReturnsFalse()
 {
   mitk::Geometry3D::Pointer geometry3D = NULL;
   MITK_ASSERT_NOT_EQUAL( geometry3D, geometry3D, "Input is NULL. Result should be false.");
 }