From de20e482adadaaef2e54e8cbdf7e13cfc7c5dd9f Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Wed, 22 Aug 2012 22:10:32 -0400 Subject: [PATCH] ENH: Allow imshow to show images when given file name. --- skimage/io/_io.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skimage/io/_io.py b/skimage/io/_io.py index 477fe8bc..4df84cd0 100644 --- a/skimage/io/_io.py +++ b/skimage/io/_io.py @@ -138,8 +138,8 @@ def imshow(arr, plugin=None, **plugin_args): Parameters ---------- - arr : ndarray - Image data. + arr : ndarray or str + Image data or name of image file. plugin : str Name of plugin to use. By default, the different plugins are tried (starting with the Python Imaging Library) until a suitable @@ -151,6 +151,8 @@ def imshow(arr, plugin=None, **plugin_args): Passed to the given plugin. """ + if isinstance(arr, basestring): + arr = call_plugin('imread', arr, plugin=plugin) return call_plugin('imshow', arr, plugin=plugin, **plugin_args)