Re: Returning an image from the viewer
There was some discussion about the save functionality in the original PR. I admit, I advocated to change "File -> Save As" from saving the overlay to saving the actual image the user sees... so feel free to send some blame for the present behavior my way. There should be an option to add a Save Overlay *button* which should allow you to grab the overlay specifically. As to your second question: I think you can send data either to a file, or to a buffer which can be read out using `skimage.io.pop`. I've used this before, but my memory is a bit fuzzy on it now. If this isn't currently available for scripting like your hoped-for functionality example, I'm sure it could be implemented. Thanks for the PR fixing the save dialog if it's RGB! On Monday, October 28, 2013 2:19:03 AM UTC-5, Juan Nunez-Iglesias wrote:
Hi all, but especially @tonysyu:
I'm using the viewer for the first time to add some interactivity to my work. Please forgive the noobish-ness: I've only ever worked on command-line stuff. (Thanks btw to @tonysyu for his awesome SciPy lightning talk, which inspired me to even dip my toes in this!)
I'm running an RGB image through a bunch of thresholding and morphological operations, and I want to fiddle with the parameters before getting back the filter output. I'm running into the following problems:
1) The file > save as dialog saves a composite image of the overlay and underlying image, where I just want the overlay. 2) The file > save as dialog actually crashes when the underlying image is RGB! (PR forthcoming) 3) But most of all, I don't actually want to save the overlay, I just want to return it to the calling process. How would one go about this? Here's my code now:
v = viewer.ImageViewer(rgbs[0]) v += CentroPlugin() v.show()
which works as expected. I'd like something like:
v = viewer.ImageViewer(rgbs[0]) v += CentroPlugin() overlay = v.show()
Is this possible?
Thanks,
Juan.
Thanks Josh! On Tue, Oct 29, 2013 at 10:25 AM, Josh Warner <silvertrumpet999@gmail.com>wrote:
There was some discussion about the save functionality in the original PR. I admit, I advocated to change "File -> Save As" from saving the overlay to saving the actual image the user sees... so feel free to send some blame for the present behavior my way.
I can see both use cases. The solution, imho, is to have two menu items, "save displayed as" and "save overlay as". I'll make a separate PR for that function. =) There should be an option to add a Save Overlay *button* which should allow
you to grab the overlay specifically.
I thought about that but wasn't able to wrap my head around how to do that before asking for help here. =)
As to your second question: I think you can send data either to a file, or to a buffer which can be read out using `skimage.io.pop`. I've used this before, but my memory is a bit fuzzy on it now. If this isn't currently available for scripting like your hoped-for functionality example, I'm sure it could be implemented.
I saw a comment in the code saying something similar to "this doesn't work for interactive sessions", which scared me off it a little bit. But I'll look into that option, which seems most suited to my needs. Thanks for the PR fixing the save dialog if it's RGB!
No worries! Hopefully it'll get reviewed soon... ;)
On Mon, Oct 28, 2013 at 6:25 PM, Josh Warner <silvertrumpet999@gmail.com>wrote:
There was some discussion about the save functionality in the original PR. I admit, I advocated to change "File -> Save As" from saving the overlay to saving the actual image the user sees... so feel free to send some blame for the present behavior my way.
There should be an option to add a Save Overlay *button* which should allow you to grab the overlay specifically. As to your second question: I think you can send data either to a file, or to a buffer which can be read out using `skimage.io.pop`. I've used this before, but my memory is a bit fuzzy on it now. If this isn't currently available for scripting like your hoped-for functionality example, I'm sure it could be implemented.
Thanks for the PR fixing the save dialog if it's RGB!
On Monday, October 28, 2013 2:19:03 AM UTC-5, Juan Nunez-Iglesias wrote:
Hi all, but especially @tonysyu:
I'm using the viewer for the first time to add some interactivity to my work. Please forgive the noobish-ness: I've only ever worked on command-line stuff. (Thanks btw to @tonysyu for his awesome SciPy lightning talk, which inspired me to even dip my toes in this!)
I'm running an RGB image through a bunch of thresholding and morphological operations, and I want to fiddle with the parameters before getting back the filter output. I'm running into the following problems:
1) The file > save as dialog saves a composite image of the overlay and underlying image, where I just want the overlay. 2) The file > save as dialog actually crashes when the underlying image is RGB! (PR forthcoming) 3) But most of all, I don't actually want to save the overlay, I just want to return it to the calling process. How would one go about this? Here's my code now:
v = viewer.ImageViewer(rgbs[0]) v += CentroPlugin() v.show()
which works as expected. I'd like something like:
v = viewer.ImageViewer(rgbs[0]) v += CentroPlugin() overlay = v.show()
Is this possible?
I'm sure this is possible, but I'd have to think a bit about the right way to implement this. Currently, the viewer knows very little about the plugins, and overlays are drawn in a different layer than the image. It's definitely possible to retrieve the overlay from the viewer object, but I'm not sure how to do it cleanly. That said, I don't know why I didn't think to return an image from the viewer. Thanks for the idea: https://github.com/scikit-image/scikit-image/pull/805 -T
Thanks,
Juan.
-- 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.
participants (3)
-
Josh Warner
-
Juan Nunez-Iglesias
-
Tony Yu