From b2c413dad0e0dc01b75ccd33b57a0825e4e71af0 Mon Sep 17 00:00:00 2001 From: Olivier Debeir Date: Thu, 4 Oct 2012 17:30:21 +0200 Subject: [PATCH] rename some test to demo --- ...bitbilateral.py => demo_16bitbilateral.py} | 0 skimage/rank/tests/demo_all.py | 24 +++++++++++++++++++ .../{test_benchmark.py => demo_benchmark.py} | 0 3 files changed, 24 insertions(+) rename skimage/rank/tests/{test_16bitbilateral.py => demo_16bitbilateral.py} (100%) create mode 100644 skimage/rank/tests/demo_all.py rename skimage/rank/tests/{test_benchmark.py => demo_benchmark.py} (100%) diff --git a/skimage/rank/tests/test_16bitbilateral.py b/skimage/rank/tests/demo_16bitbilateral.py similarity index 100% rename from skimage/rank/tests/test_16bitbilateral.py rename to skimage/rank/tests/demo_16bitbilateral.py diff --git a/skimage/rank/tests/demo_all.py b/skimage/rank/tests/demo_all.py new file mode 100644 index 00000000..8001a25f --- /dev/null +++ b/skimage/rank/tests/demo_all.py @@ -0,0 +1,24 @@ +import numpy as np +import matplotlib.pyplot as plt + +from skimage import data +from skimage.rank import crank8_percentiles +from skimage.rank import crank16_bilateral + +if __name__ == '__main__': + a8 = (data.coins()).astype('uint8') + + a16 = (data.coins()).astype('uint16')*16 + selem = np.ones((20,20),dtype='uint8') + f1 = crank8_percentiles.mean(a8,selem = selem,p0=.1,p1=.9) + f2 = crank16_bilateral.mean(a16,selem = selem,bitdepth=12,s0=500,s1=500) + + plt.figure() + plt.imshow(np.hstack((a8,f1))) + plt.colorbar() + + plt.figure() + plt.imshow(np.hstack((a16,f2))) + plt.colorbar() + + plt.show() diff --git a/skimage/rank/tests/test_benchmark.py b/skimage/rank/tests/demo_benchmark.py similarity index 100% rename from skimage/rank/tests/test_benchmark.py rename to skimage/rank/tests/demo_benchmark.py