ecf62ac20ef561df4265c3d1abd8c59b1e73895f,tests/modules/test_threshold.py,,test_threshold_otsu3_image,#,961

Before Change



    t_local, t_global = module.get_threshold(image, workspace)

    t_local_expected, t_global_expected = centrosome.threshold.get_threshold(
        centrosome.threshold.TM_OTSU,
        cellprofiler.modules.threshold.TS_ADAPTIVE,
        data,

After Change



    t_local, t_global, t_guide = module.get_threshold(image, workspace)

    t_guide_expected = skimage.filters.threshold_multiotsu(data[mask], nbins=128)[0]

    t_local_expected = module._get_adaptive_threshold(numpy.where(mask, data, numpy.nan),
                                                      skimage.filters.threshold_multiotsu,
                                                      nbins=128,
                                                      )

    t_local_expected = module._correct_local_threshold(t_local_expected, t_guide_expected)

    numpy.testing.assert_almost_equal(t_guide, t_guide_expected)

    numpy.testing.assert_array_almost_equal(t_local, t_local_expected)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: ecf62ac20ef561df4265c3d1abd8c59b1e73895f
Time: 2020-06-11
Author: dstirling@broadinstitute.org
File Name: tests/modules/test_threshold.py
Class Name:
Method Name: test_threshold_otsu3_image


Project Name: CellProfiler/CellProfiler
Commit Name: ecf62ac20ef561df4265c3d1abd8c59b1e73895f
Time: 2020-06-11
Author: dstirling@broadinstitute.org
File Name: tests/modules/test_threshold.py
Class Name:
Method Name: test_otsu3_low


Project Name: CellProfiler/CellProfiler
Commit Name: ecf62ac20ef561df4265c3d1abd8c59b1e73895f
Time: 2020-06-11
Author: dstirling@broadinstitute.org
File Name: tests/modules/test_threshold.py
Class Name:
Method Name: test_otsu3_high