def test_dilate(self): from jicbioimage.segment import Region test_array = np.array([[0, 0, 0, 0, 0], [0, 0, 1, 1, 0], [0, 1, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0]]) region = Region(test_array) dilate_array = np.array([[0, 0, 1, 1, 0], [0, 1, 1, 1, 1], [1, 1, 1, 1, 0], [1, 1, 1, 0, 0], [0, 1, 0, 0, 0]], dtype=bool) self.assertTrue(np.array_equal(region.dilate(), dilate_array))