Re: Imshow and Linescan - first version
On Sat, Feb 25, 2012 at 11:10 AM, Tony Yu<tsyu80@gmail.com> wrote:
Plugin system ------ It might be nice to have some sort of plugin system for the image viewer. That way, tools like this could be implemented a bit more easily and, also, easily added to the viewer or ignored by the user. At the moment, we basically have a double-viewer implementation: simply vs fancy. So we separate out
imshow(x) and imshow(x, fancy=True) I thought one solution was to sub-class FigureCanvas, with extra buttons, but from what I understand, it is not that easy to do this at
Le 26/02/2012 21:15, Stéfan van der Walt a écrit : the platform independant level. But maybe adding arguments to the function call, for exemple imshow(x, set_contrast=True, linescan=True) plus keyboard toggles is enough?
agree to an extent. Nevertheless, I think providing a viewer that supplies *an infrastructure* for creating GUI tools might be really valuable. I haven't really thought through what this plugin system would look like, so it may just be a pipe dream. This is a tricky problem (which set of tools to use, etc.)--but in principle, it would be nice to have a few standard viewers, e.g., image compare, image compare + parameter adjust, mask editor (to build custom filters, e.g.) and image inspector (like the one you and Guillaume are working on).
Stéfan
What do you mean by mask editor? Something like a slider to adjust a threshold with a superimposed mask? Guillaume
On Mon, Feb 27, 2012 at 1:13 AM, Guillaume Gay <guillaume@mitotic-machine.org> wrote:
What do you mean by mask editor? Something like a slider to adjust a threshold with a superimposed mask?
It's often handy to manually construct a mask. E.g., sometimes you can see spikes in the FFT very clearly, and it would be useful to mark those for filtering. Another example of a mask editor would be to select certain areas of an image, and mark it with given colors for colorization: http://www.cs.huji.ac.il/~yweiss/Colorization/ Stéfan
On Monday, February 27, 2012 10:13:01 AM UTC+1, Guillaume wrote:
Le 26/02/2012 21:15, Stéfan van der Walt a écrit :
On Sat, Feb 25, 2012 at 11:10 AM, Tony Yu<tsyu80@gmail.com> wrote:
Plugin system ------ It might be nice to have some sort of plugin system for the image viewer. That way, tools like this could be implemented a bit more easily and, also, easily added to the viewer or ignored by the user. At the moment, we basically have a double-viewer implementation: simply vs fancy. So we separate out
imshow(x) and imshow(x, fancy=True)
My 0.6dev does not know the property fancy: In [8]: io.imshow(ctx.data, fancy=True) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/maye/Dropbox/src/scikits-image/<ipython-input-8-b10fe497c546> in <module>() ----> 1 io.imshow(ctx.data, fancy=True) [....] AttributeError: Unknown property fancy Do I need to activate something at compile time with the setup.py? Michael
I thought one solution was to sub-class FigureCanvas, with extra buttons, but from what I understand, it is not that easy to do this at the platform independant level.
But maybe adding arguments to the function call, for exemple imshow(x, set_contrast=True, linescan=True) plus keyboard toggles is enough?
agree to an extent. Nevertheless, I think providing a viewer that
supplies
*an infrastructure* for creating GUI tools might be really valuable. I haven't really thought through what this plugin system would look like, so it may just be a pipe dream. This is a tricky problem (which set of tools to use, etc.)--but in principle, it would be nice to have a few standard viewers, e.g., image compare, image compare + parameter adjust, mask editor (to build custom filters, e.g.) and image inspector (like the one you and Guillaume are working on).
Stéfan
What do you mean by mask editor? Something like a slider to adjust a threshold with a superimposed mask?
Guillaume
I think fancy depends on what plugin you have active. try io.use_plugin('qt') before doing that. -Dan On Fri, Mar 2, 2012 at 9:50 AM, Michael Aye <kmichael.aye@gmail.com> wrote:
On Monday, February 27, 2012 10:13:01 AM UTC+1, Guillaume wrote:
Le 26/02/2012 21:15, Stéfan van der Walt a écrit :
On Sat, Feb 25, 2012 at 11:10 AM, Tony Yu<tsyu80@gmail.com> wrote:
Plugin system ------ It might be nice to have some sort of plugin system for the image viewer. That way, tools like this could be implemented a bit more easily and, also, easily added to the viewer or ignored by the user. At the moment, we basically have a double-viewer implementation: simply vs fancy. So we separate out
imshow(x) and imshow(x, fancy=True)
My 0.6dev does not know the property fancy:
In [8]: io.imshow(ctx.data, fancy=True) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/maye/Dropbox/src/scikits-image/<ipython-input-8-b10fe497c546> in <module>() ----> 1 io.imshow(ctx.data, fancy=True) [....] AttributeError: Unknown property fancy
Do I need to activate something at compile time with the setup.py?
Michael
I thought one solution was to sub-class FigureCanvas, with extra buttons, but from what I understand, it is not that easy to do this at the platform independant level.
But maybe adding arguments to the function call, for exemple imshow(x, set_contrast=True, linescan=True) plus keyboard toggles is enough?
agree to an extent. Nevertheless, I think providing a viewer that supplies *an infrastructure* for creating GUI tools might be really valuable. I haven't really thought through what this plugin system would look like, so it may just be a pipe dream. This is a tricky problem (which set of tools to use, etc.)--but in principle, it would be nice to have a few standard viewers, e.g., image compare, image compare + parameter adjust, mask editor (to build custom filters, e.g.) and image inspector (like the one you and Guillaume are working on).
Stéfan
What do you mean by mask editor? Something like a slider to adjust a threshold with a superimposed mask?
Guillaume
On Mon, Feb 27, 2012 at 4:13 AM, Guillaume Gay < guillaume@mitotic-machine.org> wrote:
Le 26/02/2012 21:15, Stéfan van der Walt a écrit :
On Sat, Feb 25, 2012 at 11:10 AM, Tony Yu<tsyu80@gmail.com> wrote:
Plugin system ------ It might be nice to have some sort of plugin system for the image viewer. That way, tools like this could be implemented a bit more easily and, also, easily added to the viewer or ignored by the user.
At the moment, we basically have a double-viewer implementation: simply vs fancy. So we separate out
imshow(x) and imshow(x, fancy=True)
I thought one solution was to sub-class FigureCanvas, with extra buttons, but from what I understand, it is not that easy to do this at the platform independant level.
But maybe adding arguments to the function call, for exemple imshow(x, set_contrast=True, linescan=True) plus keyboard toggles is enough?
Hey Guillaume, I'm still tossing around ideas for implementing some sort of interactive viewer with pluggable tools. Based off your LineProfile idea, I created the beginnings of a matplotlib image-viewer<https://github.com/tonysyu/scikits-image/blob/mpl-fancy/skimage/io/_plugins/...>, which could have some sort of plugin system (not really implemented). I took a different approach than your original implementation: the line-profile output shows up as a separate figure. I think it'd be nice to have tools integrated into the image window, but I think this will be really difficult to do well (specifically, resizing the figure window and adjusting canvas area when connecting and disconnecting the tool). Using multiple figures is easier, although a little more cumbersome for the user. One advantage is that you can disconnect the tool just by closing the tool's figure (this doesn't currently work for Qt4 backends because of an MPL bug <https://github.com/matplotlib/matplotlib/pull/716>). Right now, the LineProfile tool is just a test case: the main components are an ImageWindow class and the Widget base class. I'd like to test the architecture with some different use cases (e.g. contrast-adjustment widget, mask editor, etc.) when I have the time. I could see these classes changing dramatically after testing different uses. Everything's in a single file at the moment, but the idea would be to move the Widget subclasses to some sort of "widgets" directory. -Tony P.S. Guillaume: I couldn't figure out why `img_zoomed`/`previous_axis`/`current_axis` were necessary, so I just removed them. If there was some functionality that I missed, let me know.
agree to an extent. Nevertheless, I think providing a viewer that
supplies *an infrastructure* for creating GUI tools might be really valuable. I haven't really thought through what this plugin system would look like, so it may just be a pipe dream.
This is a tricky problem (which set of tools to use, etc.)--but in principle, it would be nice to have a few standard viewers, e.g., image compare, image compare + parameter adjust, mask editor (to build custom filters, e.g.) and image inspector (like the one you and Guillaume are working on).
Stéfan
What do you mean by mask editor? Something like a slider to adjust a threshold with a superimposed mask?
Guillaume
participants (5)
-
Dan Farmer
-
Guillaume Gay
-
Michael Aye
-
Stéfan van der Walt
-
Tony Yu