예제 #1
0
def test_singleSegment():
    # Test 1 Prefixes of v for a single segment
    lineGraph = get_single_voxel_lineNobranches()
    vertices = lineGraph.number_of_nodes()
    branchPoints = 0
    verticesList = _getLinePrefixes(lineGraph, "Line.obj")
    assert verticesList[0] == vertices, "number of vertices in single segment obj {}, not {}".format(verticesList[0], vertices)
    assert verticesList[1] == branchPoints, "number of branch vertices in single segment obj {}, not {}".format(verticesList[1], branchPoints)
예제 #2
0
def test_singleSegment():
    # test if stats i.e segments, type of graph. branch, end points, and information about cycle
    # is as expected for a single segment
    lineGraph = get_single_voxel_lineNobranches()
    stats = SegmentStats(lineGraph)
    stats.setStats()
    assert stats.totalSegments == 0, "totalSegments in singleSegment sample should be 0, it is {}".format(stats.totalSegments)
    assert stats.typeGraphdict[0] == 2, "type of graph in singleSegment sample should be 2, it is {}".format(stats.typeGraphdict[0])
    assert stats.countEndPoints == 2, "number of end points in singleSegment sample should be 2, it is {}".format(stats.countEndPoints)
    assert stats.countBranchPoints == 0, "number of branch points in singleSegment sample should be 0, it is {}".format(stats.countBranchPoints)
    assert stats.hausdorffDimensionDict == {}, "hausdorffDimensionDict must be empty, it is {}".format(stats.hausdorffDimensionDict)
    assert stats.cycleInfoDict == {}, "cycleInfoDict must be empty, it is {}".format(stats.cycleInfoDict)
def test_singleSegment():
    # Test 1 Prefixes of v for a single segment
    lineGraph = get_single_voxel_lineNobranches()
    vertices = lineGraph.number_of_nodes()
    branchPoints = 0
    verticesList = _getLinePrefixes(lineGraph, "Line.obj")
    assert verticesList[
        0] == vertices, "number of vertices in single segment obj {}, not {}".format(
            verticesList[0], vertices)
    assert verticesList[
        1] == branchPoints, "number of branch vertices in single segment obj {}, not {}".format(
            verticesList[1], branchPoints)
예제 #4
0
def test_singleSegment():
    # test if stats i.e segments, type of graph. branch, end points, and information about cycle
    # is as expected for a single segment
    lineGraph = get_single_voxel_lineNobranches()
    stats = SegmentStats(lineGraph)
    stats.setStats()
    assert stats.totalSegments == 0, "totalSegments in singleSegment sample should be 0, it is {}".format(
        stats.totalSegments)
    assert stats.typeGraphdict[
        0] == 2, "type of graph in singleSegment sample should be 2, it is {}".format(
            stats.typeGraphdict[0])
    assert stats.countEndPoints == 2, "number of end points in singleSegment sample should be 2, it is {}".format(
        stats.countEndPoints)
    assert stats.countBranchPoints == 0, "number of branch points in singleSegment sample should be 0, it is {}".format(
        stats.countBranchPoints)
    assert stats.hausdorffDimensionDict == {}, "hausdorffDimensionDict must be empty, it is {}".format(
        stats.hausdorffDimensionDict)
    assert stats.cycleInfoDict == {}, "cycleInfoDict must be empty, it is {}".format(
        stats.cycleInfoDict)