@Josh, there's two issues here: whether the import io is wasteful (which, as you demonstrated, it isn't), and whether it makes sense to stick imshow under io, which is certainly not clear to me, despite the rationalisations posted to this thread. =P

I would argue that we rename the "viewer" package to "view" and include a simple imshow in there in addition to the viewer.

Juan.



On Tue, Nov 26, 2013 at 10:45 AM, Josh Warner <silvertrumpet999@gmail.com> wrote:

To answer this question and potentially shine a bit more light on the issue:

The example images shipped with the package and exposed by skimage.data actually are shipped as raw files in that directory. Upon import of skimage.data, these convenience functions (e.g. skimage.data.lena()) are actually wrapping skimage.io.imread for the fixed, known local path to each image file and returning the result.

Take a look at the __init__.py file for skimage.data to see what’s going on.

So, the io module is required - we just handle that behind the scenes for these examples.

Hope that helps someone,
Josh

On Monday, November 25, 2013 4:24:18 PM UTC-6, Michael Aye wrote:

I just stumbled over the 3 lines of code on scikits' title page:


from skimage import data, io, filter
image = data.coins() # or any NumPy array!
edges = filter.sobel(image)
io.imshow(edges)

and wondered: Isn't it a bit funny to require an I/O module to show an image that is already loaded?

My apologies if that has been discussed before.

Michael

--
You received this message because you are subscribed to the Google Groups "scikit-image" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.