예제 #1
0
def test_3d_fallback_white_tophat():
    image = np.zeros((7, 7, 7), dtype=bool)
    image[2, 2:4, 2:4] = 1
    image[3, 2:5, 2:5] = 1
    image[4, 3:5, 3:5] = 1
    new_image = grey.white_tophat(image)
    footprint = ndimage.generate_binary_structure(3,1)
    image_expected = ndimage.white_tophat(image,footprint=footprint)
    testing.assert_array_equal(new_image, image_expected)
예제 #2
0
def test_3d_fallback_white_tophat():
    image = np.zeros((7, 7, 7), dtype=bool)
    image[2, 2:4, 2:4] = 1
    image[3, 2:5, 2:5] = 1
    image[4, 3:5, 3:5] = 1

    with expected_warnings(['operator.*deprecated|\A\Z']):
        new_image = grey.white_tophat(image)
    footprint = ndi.generate_binary_structure(3,1)
    with expected_warnings(['operator.*deprecated|\A\Z']):
        image_expected = ndi.white_tophat(image,footprint=footprint)
    testing.assert_array_equal(new_image, image_expected)
예제 #3
0
 def test_white_tophat_black_pixel(self):
     for s in self.selems:
         tophat = grey.white_tophat(self.black_pixel, s)
         assert np.all(tophat == 0)
예제 #4
0
 def test_white_tophat_black_pixel(self):
     for s in self.selems:
         tophat = grey.white_tophat(self.black_pixel, s)
         assert np.all(tophat == 0)