Weird imsave inverting behaviour

Stéfan van der Walt stefan at sun.ac.za
Mon May 27 05:35:45 EDT 2013


On Mon, May 27, 2013 at 8:51 AM, Johannes Schönberger
<jschoenberger at demuc.de> wrote:
>
>  - depending on the plugin, the code and comment / doc string quality should be improved
>  - what's the purpose of _colormixer.pyx, _histogram.pyx, q_histogram.py, q_color_mixer.py etc. and why are they in the io plugin directory?

These are used in the fancy QT image viewer, i.e. "imshow(image, fancy=True)".

>  - the way plugins are managed should be overhauled and we should discuss it together before implementation
>
> My ideas:
>
> - rather than having .ini files I would opt for `register(plugin, desc, funcs, setup_func, *args, **kwargs)` and `unregister(plugin)` functions. This enables also users to add new plugins at runtime.

This sounds very similar to the ideas mentioned by Almar Klein earlier
this month:

https://groups.google.com/d/msg/imageio/jNwYY6B8n7Y/svdUiYWA4mMJ

Unfortunately, there's a trade-off between having things "just work"
and the amount of magic that happens behind the scene.  When starting
scikit-image, we set it as a priority that a person should be able to
do ``imread(...)`` on almost any system and have it work.  I think
this was an important requirement for having demos Just Work.

> - what is indicated as `args` and `kwargs` above should definitely contain two more things: an explicit whitelist of supported file formats, extensions and dtypes or an explicit blacklist of file formats, extensions and dtypes. This could be represented as a dictionary:
>
>         {['png']: ['uint8', 'float', '…'], ['tif', 'tiff']: … }
>
>     It allows us to automatically select an available plugin for the given data or raise an error.

Having formats and data-types specified is a good idea.  It can also
be done using the ini-file format, but I'd prefer the approach you
suggest.  That said, let me motivate those configuration files: the
idea was that one could add plugins by simply dropping the appropriate
files in-place.  However, the right place for those plugins to live
would probably be inside the skimage repository, so it doesn't matters
that much.

> - Explicitly selecting a plugin should be possible through an extra argument to `imread`, `imsave`. E.g. `imsave(file, data, plugin='freeimage')`.

Just verifying that this is the way it currently functions.

Stéfan



More information about the scikit-image mailing list