stupid question: Why is imshow in io module?

Juan Nunez-Iglesias jni.soma at gmail.com
Mon Nov 25 22:55:13 EST 2013


@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 at 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.dataactually 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<https://github.com/scikit-image/scikit-image/blob/master/skimage/data/__init__.py>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 at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20131126/7546a3fd/attachment.html>


More information about the scikit-image mailing list