コード例 #1
0
def test_tranform_cut_coords():
    affine = np.eye(4)

    # test that when n_cuts is 1 we do get an iterable
    for direction in "xyz":
        assert_true(hasattr(_transform_cut_coords([4], direction, affine), "__iter__"))

    # test that n_cuts after as before function call
    n_cuts = 5
    cut_coords = np.arange(n_cuts)
    for direction in "xyz":
        assert_equal(len(_transform_cut_coords(cut_coords, direction, affine)), n_cuts)
コード例 #2
0
def test_tranform_cut_coords():
    affine = np.eye(4)

    # test that when n_cuts is 1 we do get an iterable
    for direction in 'xyz':
        assert_true(
            hasattr(_transform_cut_coords([4], direction, affine), "__iter__"))

    # test that n_cuts after as before function call
    n_cuts = 5
    cut_coords = np.arange(n_cuts)
    for direction in 'xyz':
        assert_equal(len(_transform_cut_coords(cut_coords, direction, affine)),
                     n_cuts)