diff --git a/scikits/image/morphology/tests/test_morphology.py b/scikits/image/morphology/tests/test_morphology.py index 5bde664b..ff22c458 100644 --- a/scikits/image/morphology/tests/test_morphology.py +++ b/scikits/image/morphology/tests/test_morphology.py @@ -15,48 +15,49 @@ class TestMorphology(): def morph_worker(self, img, fn, morph_func, strel_func): matlab_results = np.load(os.path.join(data_dir, fn)) k = 0 - for expected_result in matlab_results: + for arrname in sorted(matlab_results): + expected_result = matlab_results[arrname] mask = strel_func(k) actual_result = morph_func(lena, mask) assert_equal(expected_result, actual_result) k = k + 1 def test_erode_diamond(self): - self.morph_worker(lena, "diamond-erode-matlab-output.npy", + self.morph_worker(lena, "diamond-erode-matlab-output.npz", greyscale_erode, diamond) def test_dilate_diamond(self): - self.morph_worker(lena, "diamond-dilate-matlab-output.npy", + self.morph_worker(lena, "diamond-dilate-matlab-output.npz", greyscale_dilate, diamond) def test_open_diamond(self): - self.morph_worker(lena, "diamond-open-matlab-output.npy", + self.morph_worker(lena, "diamond-open-matlab-output.npz", greyscale_open, diamond) def test_close_diamond(self): - self.morph_worker(lena, "diamond-close-matlab-output.npy", + self.morph_worker(lena, "diamond-close-matlab-output.npz", greyscale_close, diamond) def test_tophat_diamond(self): - self.morph_worker(lena, "diamond-tophat-matlab-output.npy", + self.morph_worker(lena, "diamond-tophat-matlab-output.npz", greyscale_white_top_hat, diamond) def test_bothat_diamond(self): - self.morph_worker(lena, "diamond-bothat-matlab-output.npy", + self.morph_worker(lena, "diamond-bothat-matlab-output.npz", greyscale_black_top_hat, diamond) def test_erode_disk(self): - self.morph_worker(lena, "disk-erode-matlab-output.npy", + self.morph_worker(lena, "disk-erode-matlab-output.npz", greyscale_erode, disk) def test_dilate_disk(self): - self.morph_worker(lena, "disk-dilate-matlab-output.npy", + self.morph_worker(lena, "disk-dilate-matlab-output.npz", greyscale_dilate, disk) def test_open_disk(self): - self.morph_worker(lena, "disk-open-matlab-output.npy", + self.morph_worker(lena, "disk-open-matlab-output.npz", greyscale_open, disk) def test_close_disk(self): - self.morph_worker(lena, "disk-close-matlab-output.npy", + self.morph_worker(lena, "disk-close-matlab-output.npz", greyscale_close, disk)