Ejemplo n.º 1
0
def test_flatten_nav():
    s = Slice(
        origin=(0, 0, 0, 0),
        shape=Shape((1, 1, 1, 1), sig_dims=2)
    )
    sflat = Slice(
        origin=(0, 0, 0),
        shape=Shape((1, 1, 1), sig_dims=2)
    )
    assert s.flatten_nav((1, 1, 1, 1)) == sflat
Ejemplo n.º 2
0
def test_flatten_nav_2():
    s = Slice(
        origin=(0, 0, 0, 0),
        shape=Shape((2, 16, 16, 16), sig_dims=2)
    )
    sflat = Slice(
        origin=(0, 0, 0),
        shape=Shape((32, 16, 16), sig_dims=2)
    )
    assert s.flatten_nav((16, 16, 16, 16)) == sflat
Ejemplo n.º 3
0
def test_flatten_roundtrip():
    s = Slice(origin=(0, 0, 0, 0), shape=Shape((2, 16, 16, 16), sig_dims=2))
    sflat = Slice(origin=(0, 0, 0), shape=Shape((32, 16, 16), sig_dims=2))
    assert s.flatten_nav((16, 16, 16, 16)) == sflat
    assert unravel_nav(sflat, (16, 16, 16, 16)) == s