diff --git a/skimage/data/_blobs_3d_fiji_skeleton.tif b/skimage/data/_blobs_3d_fiji_skeleton.tif new file mode 100644 index 00000000..d5cdd051 Binary files /dev/null and b/skimage/data/_blobs_3d_fiji_skeleton.tif differ diff --git a/skimage/morphology/tests/data/3/pngs/1.png b/skimage/morphology/tests/data/3/pngs/1.png deleted file mode 100644 index da940f11..00000000 Binary files a/skimage/morphology/tests/data/3/pngs/1.png and /dev/null differ diff --git a/skimage/morphology/tests/data/3/pngs/2.png b/skimage/morphology/tests/data/3/pngs/2.png deleted file mode 100644 index ada13a9e..00000000 Binary files a/skimage/morphology/tests/data/3/pngs/2.png and /dev/null differ diff --git a/skimage/morphology/tests/data/3/pngs/3.png b/skimage/morphology/tests/data/3/pngs/3.png deleted file mode 100644 index 00ee7d1f..00000000 Binary files a/skimage/morphology/tests/data/3/pngs/3.png and /dev/null differ diff --git a/skimage/morphology/tests/data/3/pngs/5.png b/skimage/morphology/tests/data/3/pngs/5.png deleted file mode 100644 index 8378036e..00000000 Binary files a/skimage/morphology/tests/data/3/pngs/5.png and /dev/null differ diff --git a/skimage/morphology/tests/data/3/pngs/6.png b/skimage/morphology/tests/data/3/pngs/6.png deleted file mode 100644 index 3c6051ae..00000000 Binary files a/skimage/morphology/tests/data/3/pngs/6.png and /dev/null differ diff --git a/skimage/morphology/tests/data/3/pngs/7.png b/skimage/morphology/tests/data/3/pngs/7.png deleted file mode 100644 index 61eb7001..00000000 Binary files a/skimage/morphology/tests/data/3/pngs/7.png and /dev/null differ diff --git a/skimage/morphology/tests/data/3/stack.tif b/skimage/morphology/tests/data/3/stack.tif deleted file mode 100644 index 28752135..00000000 Binary files a/skimage/morphology/tests/data/3/stack.tif and /dev/null differ diff --git a/skimage/morphology/tests/data/3/stack_fiji.tif b/skimage/morphology/tests/data/3/stack_fiji.tif deleted file mode 100644 index 93737675..00000000 Binary files a/skimage/morphology/tests/data/3/stack_fiji.tif and /dev/null differ diff --git a/skimage/morphology/tests/data/4/1_fiji.png b/skimage/morphology/tests/data/4/1_fiji.png deleted file mode 100644 index 03a7b79a..00000000 Binary files a/skimage/morphology/tests/data/4/1_fiji.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/pngs/1.png b/skimage/morphology/tests/data/4/pngs/1.png deleted file mode 100644 index d03660d2..00000000 Binary files a/skimage/morphology/tests/data/4/pngs/1.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/pngs/2.png b/skimage/morphology/tests/data/4/pngs/2.png deleted file mode 100644 index efa5c104..00000000 Binary files a/skimage/morphology/tests/data/4/pngs/2.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/pngs/3.png b/skimage/morphology/tests/data/4/pngs/3.png deleted file mode 100644 index 28100eee..00000000 Binary files a/skimage/morphology/tests/data/4/pngs/3.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/pngs/4.png b/skimage/morphology/tests/data/4/pngs/4.png deleted file mode 100644 index 28100eee..00000000 Binary files a/skimage/morphology/tests/data/4/pngs/4.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/pngs/5.png b/skimage/morphology/tests/data/4/pngs/5.png deleted file mode 100644 index 28100eee..00000000 Binary files a/skimage/morphology/tests/data/4/pngs/5.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/pngs/6.png b/skimage/morphology/tests/data/4/pngs/6.png deleted file mode 100644 index 28100eee..00000000 Binary files a/skimage/morphology/tests/data/4/pngs/6.png and /dev/null differ diff --git a/skimage/morphology/tests/data/4/stack.tif b/skimage/morphology/tests/data/4/stack.tif deleted file mode 100644 index a4f9f6b7..00000000 Binary files a/skimage/morphology/tests/data/4/stack.tif and /dev/null differ diff --git a/skimage/morphology/tests/data/4/stack_fiji.tif b/skimage/morphology/tests/data/4/stack_fiji.tif deleted file mode 100644 index c0d182fd..00000000 Binary files a/skimage/morphology/tests/data/4/stack_fiji.tif and /dev/null differ diff --git a/skimage/morphology/tests/data/bat/bat-cochlea-volume.tif b/skimage/morphology/tests/data/bat/bat-cochlea-volume.tif deleted file mode 100644 index 0613f1e7..00000000 Binary files a/skimage/morphology/tests/data/bat/bat-cochlea-volume.tif and /dev/null differ diff --git a/skimage/morphology/tests/data/bat/bat-cochlea-volume_fiji.tif b/skimage/morphology/tests/data/bat/bat-cochlea-volume_fiji.tif deleted file mode 100644 index e6ce0122..00000000 Binary files a/skimage/morphology/tests/data/bat/bat-cochlea-volume_fiji.tif and /dev/null differ diff --git a/skimage/morphology/tests/test_skeletonize_3d.py b/skimage/morphology/tests/test_skeletonize_3d.py index 08a60f46..d373f0d5 100644 --- a/skimage/morphology/tests/test_skeletonize_3d.py +++ b/skimage/morphology/tests/test_skeletonize_3d.py @@ -11,7 +11,7 @@ import scipy.ndimage as ndi import skimage from skimage import io, draw, data_dir -#from skimage import draw +from skimage.data import binary_blobs from skimage.util import img_as_ubyte from skimage.morphology import skeletonize_3d @@ -162,30 +162,15 @@ def test_two_hole_image(): assert_equal(res, img_f) -# trivial 3D images -def test_simple_3d(): - for fname in ['3/stack', '4/stack']: - yield check_skel_3d, fname - - -# 'slow' test: Bat Cochlea from FIJI collections. -def test_large(): - for fname in ['bat/bat-cochlea-volume']: - yield check_skel_3d, fname - - -def get_data_path(): - # XXX this is a bad temp hack - return os.path.join(os.path.split(skimage.__file__)[0], - 'morphology', - 'tests', - 'data') - -def check_skel_3d(fname): - img = io.imread(os.path.join(get_data_path(), fname + '.tif')) - img_f = io.imread(os.path.join(get_data_path(), fname + '_fiji.tif')) +def test_3d_vs_fiji(): + # generate an image with blobs and compate its skeleton to + # the skeleton generated by FIJI + img = binary_blobs(32, 0.05, n_dim=3, seed=1234) + img = img[:-2, ...] + img = img.astype(np.uint8)*255 img_s = skeletonize_3d(img) + img_f = io.imread(os.path.join(data_dir, "_blobs_3d_fiji_skeleton.tif")) assert_equal(img_s, img_f)