Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lastest ginga mucks up postage stamps #32

Closed
stscieisenhamer opened this issue Nov 6, 2015 · 18 comments
Closed

Lastest ginga mucks up postage stamps #32

stscieisenhamer opened this issue Nov 6, 2015 · 18 comments

Comments

@stscieisenhamer
Copy link
Contributor

Everything is doubled.

@pllim
Copy link
Contributor

pllim commented Nov 6, 2015

Eric refactored a bunch of stuff. You might want to see his commit changes for clues.

@stscieisenhamer
Copy link
Contributor Author

Actually its not what I was afraid of; actual functionality change. Seems more that some layout default, such as stretch, for ImageViewCanvas, has changed. Not critical.

@ejeschke
Copy link
Collaborator

@stscieisenhamer, I'm trying MultiImage. I can draw a region and it creates an image in the lower bar, but I cannot figure out how to add a new image. Can I add new cutouts from a single image?

Edit: I'm beginning to grok this. Switch to another image in the channel to add a new stamp. I take it that it is not possible to add multiple stamps per same image?

@stscieisenhamer
Copy link
Contributor Author

If you drag another image into the channel, it should add automatically. Or if other images are in the channel already, just rotate to them using the arrow keys.

And no, there is only one cutout.

@ejeschke
Copy link
Collaborator

Cool. Is there a limit on the number of stamps?

@ejeschke
Copy link
Collaborator

And MIPick just works as another way to set the region?

@ejeschke
Copy link
Collaborator

Anyway, stamps seem to work for me. What kind of problem are you seeing?

@stscieisenhamer
Copy link
Contributor Author

No: no limit, except for hardware

Yes: MIPick is just another way to choose the region, combining the stats of Pick while fixing on a sky region instead of a pixel region. Sometimes this gets confused when an image has no overlapping sky. Haven't dealt with that yet.

And the problem of this issue is just a visual. At some commit which I forget, previously the stamps would center and fill the HBox. Then as more were added, the HBox would evenly divide, each filling an equal area.

Now, the first one only takes the left 1/4 of the space. As more add, the remaining quarters are filled. Then, as more are added, the evenly divided behavior takes over.

I started investigating: has something to do with an object changing from HBox to a native Qt.Widget, but I didn't get too far.

@ejeschke
Copy link
Collaborator

I see what you are saying. You can probably fix that with the right "expand" options set on the horizontal container widget in your build_gui() method. To me it doesn't look bad now.

Couple of notes, FWIW:

  1. I notice now that once the row gets filled there is no way to get to the new stamps except by resizing the top level window (which is limited by screen size). Might be good to embed the container in a ScrollArea--then scroll bars would appear automatically when it filled up and overflowed.

  2. I think this kind of plugin could certainly work across channels as well. In that case it probably would be better as a global plugin. I notice that if I add a new channel and start a second MultiDim in that then it's difficult to tell anyway which images belong to which channel. Another possible configuration would be one stamp for each channel, and a stamp would update as you stepped through images in that channel. That probably fits better with the idea behind @hcferguson's workflow (as I understand it).

  3. I can imagine that it might be convenient to have a keystroke (and button in the GUI) to add a stamp. That way you don't always automatically get a new stamp when you visit a new image. This could be a preference, maybe?

  4. Might be nice to have a little "X" button or at least a right-click context menu to close stamps that you are done with.

Looks like a very useful plugin!

@stscieisenhamer
Copy link
Contributor Author

Excellent suggestions! And, I see a path to success....

The desire was to have all stamps shown so that as you view the main image, you can see what that same region is in the other images. How this was to work with the multi images per channel and multiple channels was unclear. However, @ejeschke suggestion #3 gave the needed hint. A possible workflow is then:

  • MultiImage becomes a global plugin, and is started at any point
  • To add an image, an explicit keystroke is needed.
  • Where the image comes from is irrelevant
  • To cycle through the images, a different set of keystrokes, or overload of the arrow keys, will cycle through the JUST the images added to MultiDim, as long as that plugin has focus. Again, the cycling would cross channels if necessary.
  • As in Write access to Jonathan #4 above, images would be removed.
  • The image in the main viewer does not actually have to be part of the stamps. <- Need to think about that.

@pllim
Copy link
Contributor

pllim commented Nov 19, 2015

As @ejeschke stated to me before, the same image can be loaded into different channels. How do you plan to handle duplicates?

@ejeschke
Copy link
Collaborator

@pllim, would that be a problem? If the stamps are added manually, and are maintained on a per-image basis, then if the user decides to open two different stamps for the same image then that's a kind of user error, IMO, no matter how you navigated to the images (in one channel or two, etc.).

@hcferguson
Copy link

I could see a potential benefit of having the same image in two different stamps with a different colormap. I actually used this kind of thing in ds9 blinking between images doing supernova searches. When looking at potential candidates, it was useful to have both a heavy stretch and a log stretch handy.

@pllim
Copy link
Contributor

pllim commented Nov 20, 2015

Okay. Just want to make sure we covered this feature.

@stscieisenhamer
Copy link
Contributor Author

OK. Sounds like a plan. I'll be making separate issues to do the implementation, since this discussion went off-the-rails-with-respect-to-the-issue.

With-respect-to-the-issue, I'm closing. Not really a functional nor usability issue. Will revisit after functionality changes.

@ejeschke
Copy link
Collaborator

@stscieisenhamer, @pllim

TL;DR: postage stamps fixed in latest ginga, please see MultiImage edits I posted to @pllim's ginga-dev box folder; all other STScI plugins I was able to test look ok, but please test and LMK

longer explanation: The latest ginga in master completes a unification of the widget-specific code (such as GingaQt and GingaGtk, etc). Almost all platform-specific widget code now has been pushed all the way down into the Widgets.py wrappers. This doesn't much effect the plugins (as they were almost all already working with wrapped versions) except in instances where you want to make a call directly against the Qt API (say)--in such cases you need to extract the widget with get_widget(). I only found a couple of spots in MultiImage where this was happening--you can see the trivial changes I made to get it working with the latest. And--bonus--the postage stamps are working again as I think you expect!

@pllim
Copy link
Contributor

pllim commented Nov 24, 2015

@ejeschke , I made your edited version into a PR (see #50). @stscieisenhamer , what do you think?

@pllim pllim reopened this Nov 24, 2015
@pllim
Copy link
Contributor

pllim commented Nov 24, 2015

Fixed by #50. Thanks, @ejeschke !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants