Beispiel #1
0
def test_illumination_mean(image_files):
    illum = pre.find_background_illumination(image_files, radius=1,
                                             quantile=0.5)
    illum_true = np.array([[161, 174, 188,  81,  94],
                           [174, 174,  81, 161,  94],
                           [174,  67, 161, 121, 161],
                           [134, 107, 107, 161, 215],
                           [134, 134, 134, 174, 215]], np.uint8)
    np.testing.assert_array_almost_equal(illum, illum_true, decimal=1)
Beispiel #2
0
def test_illumination_median(image_files):
    illum = pre.find_background_illumination(image_files,
                                             radius=1,
                                             quantile=0.5,
                                             stretch_quantile=1e-7,
                                             method='median')
    illum_true = np.array([[4., 5., 4., 1., 1.], [4., 6., 2., 4., 2.],
                           [8., 3., 4., 2., 7.], [3., 3., 3., 7., 6.],
                           [3., 3., 3., 7., 7.]]) / 10
    np.testing.assert_array_almost_equal(illum, illum_true, decimal=1)
Beispiel #3
0
def test_illumination_median(image_files):
    illum = pre.find_background_illumination(image_files, radius=1,
                                             quantile=0.5,
                                             stretch_quantile=1e-7,
                                             method='median')
    illum_true = np.array([[ 4.,  5.,  4.,  1.,  1.],
                           [ 4.,  6.,  2.,  4.,  2.],
                           [ 8.,  3.,  4.,  2.,  7.],
                           [ 3.,  3.,  3.,  7.,  6.],
                           [ 3.,  3.,  3.,  7.,  7.]]) / 10
    np.testing.assert_array_almost_equal(illum, illum_true, decimal=1)
Beispiel #4
0
def test_illumination_mean(image_files):
    illum = pre.find_background_illumination(image_files, radius=1,
                                             quantile=0.5,
                                             stretch_quantile=1e-7,
                                             method='mean')
    illum_true = np.array([[5.33, 5.33, 4.67, 1.67, 1.67],
                           [3.67, 6.67, 2.67, 4.33, 3.00],
                           [6.67, 3.00, 4.33, 3.00, 5.33],
                           [2.67, 2.67, 2.67, 6.67, 6.00],
                           [3.33, 2.00, 2.33, 6.33, 7.33]]) / 10
    np.testing.assert_array_almost_equal(illum, illum_true, decimal=1)
Beispiel #5
0
def test_illumination_mean(image_files):
    illum = pre.find_background_illumination(image_files,
                                             radius=1,
                                             quantile=0.5,
                                             stretch_quantile=1e-7,
                                             method='mean')
    illum_true = np.array(
        [[5.33, 5.33, 4.67, 1.67, 1.67], [3.67, 6.67, 2.67, 4.33, 3.00],
         [6.67, 3.00, 4.33, 3.00, 5.33], [2.67, 2.67, 2.67, 6.67, 6.00],
         [3.33, 2.00, 2.33, 6.33, 7.33]]) / 10
    np.testing.assert_array_almost_equal(illum, illum_true, decimal=1)
Beispiel #6
0
def test_illumination_median(image_files):
    illum = pre.find_background_illumination(
        image_files, radius=1, quantile=0.5, stretch_quantile=1e-7, method="median"
    )
    illum_true = (
        np.array(
            [
                [4.0, 5.0, 4.0, 1.0, 1.0],
                [4.0, 6.0, 2.0, 4.0, 2.0],
                [8.0, 3.0, 4.0, 2.0, 7.0],
                [3.0, 3.0, 3.0, 7.0, 6.0],
                [3.0, 3.0, 3.0, 7.0, 7.0],
            ]
        )
        / 10
    )
    np.testing.assert_array_almost_equal(illum, illum_true, decimal=1)