Beispiel #1
0
def test_load_imagedata_fails():
    expectedLength = 65535
    expectedDepth = 1
    expectedSize = 256
    inputData = np.zeros((expectedLength, expectedDepth), dtype=np.uint8)

    with pytest.raises(ValueError):
        imdata, imsize, depth = untiler.load_image_data(inputData, expectedSize)

    print("# OK - %s " % (inspect.stack()[0][3]))
def test_load_imagedata_fails():
    expectedLength = 65535
    expectedDepth = 1
    expectedSize = 256
    inputData = np.zeros((expectedLength, expectedDepth), dtype=np.uint8)

    with pytest.raises(ValueError):
        imdata, imsize, depth = untiler.load_image_data(
            inputData, expectedSize)

    print("# OK - %s " % (inspect.stack()[0][3]))
Beispiel #3
0
def test_load_imagedata_grey():
    expectedLength = 65536
    expectedDepth = 1
    expectedSize = 256
    inputData = np.zeros((expectedLength, expectedDepth), dtype=np.uint8)

    imdata, imsize, depth = untiler.load_image_data(inputData, expectedSize)

    assert imdata.shape == (expectedSize, expectedSize, expectedDepth,)

    assert imsize == expectedLength

    assert depth == expectedDepth
    print("# OK - %s " % (inspect.stack()[0][3]))
Beispiel #4
0
def test_load_imagedata_random():
    expectedSize = int(np.random.rand() * 256)
    expectedLength = expectedSize ** 2
    expectedDepth = int(np.random.rand() * 5)

    inputData = np.zeros((expectedLength, expectedDepth), dtype=np.uint8)

    imdata, imsize, depth = untiler.load_image_data(inputData, expectedSize)

    assert imdata.shape == (expectedSize, expectedSize, expectedDepth,)

    assert imsize == expectedLength

    assert depth == expectedDepth
    print("# OK - %s " % (inspect.stack()[0][3]))
def test_load_imagedata_grey():
    expectedLength = 65536
    expectedDepth = 1
    expectedSize = 256
    inputData = np.zeros((expectedLength, expectedDepth), dtype=np.uint8)

    imdata, imsize, depth = untiler.load_image_data(inputData, expectedSize)

    assert imdata.shape == (
        expectedSize,
        expectedSize,
        expectedDepth,
    )

    assert imsize == expectedLength

    assert depth == expectedDepth
    print("# OK - %s " % (inspect.stack()[0][3]))
def test_load_imagedata_random():
    expectedSize = int(np.random.rand() * 256)
    expectedLength = expectedSize**2
    expectedDepth = int(np.random.rand() * 5)

    inputData = np.zeros((expectedLength, expectedDepth), dtype=np.uint8)

    imdata, imsize, depth = untiler.load_image_data(inputData, expectedSize)

    assert imdata.shape == (
        expectedSize,
        expectedSize,
        expectedDepth,
    )

    assert imsize == expectedLength

    assert depth == expectedDepth
    print("# OK - %s " % (inspect.stack()[0][3]))