From abcbe673a9a5a33c8c768bd0b6b4136ede3b2e71 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Tue, 13 Dec 2011 10:17:12 -0500 Subject: [PATCH] Add test for reading uint16 image --- skimage/data/chessboard_GRAY_U16.tif | Bin 0 -> 80110 bytes skimage/io/tests/test_pil.py | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 skimage/data/chessboard_GRAY_U16.tif diff --git a/skimage/data/chessboard_GRAY_U16.tif b/skimage/data/chessboard_GRAY_U16.tif new file mode 100644 index 0000000000000000000000000000000000000000..13f78ee5b07a33ba29784500e89f07ea5cb60ff2 GIT binary patch literal 80110 zcmeI4L2e{P5Jk%jLM&kecR;h66<3%YC*cg-Xs*G=t2vPA8k~~9<^Gwum?um1Yz@`X zkyc3W)vva!5T8H)ar}H7=f8&!$HVQ_zqfx6FJAxf{Q8&M`yZZPpXYvh@%qVbw8ubhxsrc?H-uZ$rIOomiT$z?xXAxtcV$Yex%n{>7&uf9>I#3VLsAptMt+6 zWRGA)%rGD6wN?6Pbh1aVB4(J6^x7(YG&TbR(JW_AAIYOt1S?{O`Dm82r;p^(DuNX;!+bQ$+0#ezXcfVVm|;Ge z@{#EhrSEv@~XA~)#Pw+;7CN_U;vKC5%rt~~|b>Jh2E?hN;-*B1hbEj@kc z=ftbAU*uV;xq^wFMF|Mz@e%^8go`>g!^>V0KUANm++zJJ}%Iq_Lb z%rGD3<9;qi$9xPD^Xqk4`Mi2x&k}v;!{^ogd%%3$XY;y4up(yo`|fMA_iKIJXY;y4 zup(xdkJo1J*ZR26=5>c)Ma(cCug%`C86WHWMCZxU}*+^r4TppHVO0^?CJ@Mt{A}%HOZvR|fT=kDl?fyPtF7vzC}) zKFo*tX!pRJPM)~#v&83ByN|L*up(yo`H@~*rH@7@dju|Fdxlw_VkfFT1BuTW|)s=IeYp@9<3r+5i`t3 zvz$GBB#%}RtcV%rqgl?LK9WbP2v)=l^U*A4PanynRRk+yhWTigv!{>b(JF!!F~fW` z%h}UM@@N&oikM+On&s^2BYCunU`5O@AI)<1^pQMTMX(}fn2%;TdyJ3ueWLT^{!Wn_ zbUXWoyJw}lPHdmmdB&|e$eSJTZ*qYRbK71y&dtgo{Ph9ue?(?eMN7*A- z5i|V!NUyEZN28NHf)z2te5BV_>7&uf9>I#3VLsAptMt+6WRGA)%rGD6wN?6Pbh1aV zB4(J6^x7(YG&@{#0>M%EN4$2 n$)i;SD`JNEXqL05kL1xRf)z2td^F41(?{}X6~T&_@pSwLHyqnF literal 0 HcmV?d00001 diff --git a/skimage/io/tests/test_pil.py b/skimage/io/tests/test_pil.py index 058e1dc9..b01bd42f 100644 --- a/skimage/io/tests/test_pil.py +++ b/skimage/io/tests/test_pil.py @@ -51,6 +51,14 @@ def test_bilevel(): img = imread(os.path.join(data_dir, 'checker_bilevel.png')) assert_array_equal(img, expected) +@skipif(not PIL_available) +def test_imread_uint16(): + expected = np.load(os.path.join(data_dir, 'chessboard_GRAY_U8.npy')) + img = imread(os.path.join(data_dir, 'chessboard_GRAY_U16.tif')) + assert img.dtype == np.uint16 + assert_array_almost_equal(img, expected) + + class TestSave: def roundtrip(self, dtype, x, scaling=1): f = NamedTemporaryFile(suffix='.png')