Closed pllim closed 9 years ago
Also related: Is there a feature in Ginga that is similar to "match frames" in DS9, to match the current zoom and position across all frames?
@pllim, couldl you try commit d556039f515f27010ce3d7912779a587b172a84b? I believe this fixes the issue.
This relates to when the settings for autocenter, autozoom and autocuts apply. If a new image is set to the viewer (e.g. self.fitsimage.set_image()
) then these settings will apply, if the current image is modified (e.g. image.set_data()
) then they will not be applied. I think this makes sense, as these are advertised as applying to "new" images only.
There is a feature to share settings (e.g. scale (zoom) and pan position) between viewers. It is not documented or very well tested and the UI is currently poor. It is a good candidate for a better implementation of the workspace or channel dialogs.
Here is how you do it, if you want to play with it:
Choose "New Workspace" from the Workspace
menu. In the dialog,
You will get a sub-workspace embedded as a tab in the Channels workspace. It will contain the number of panels you choose in step 3. You can drag files to these windows just as usual. Pan and zoom settings made to one will apply to the other.
BTW, if you open Preferences for one of these channels and change the "Pan coord" setting to "wcs", then the two frames should align pan by coordinate position, not data position. This is especially useful if you turn on the "mark center" preference for each channel.
This pan by wcs feature is definitely not well tested and I would appreciate feedback. I've occasionally seen some wonky zoom behavior when two frames are linked and this is enabled.
@ejeschke , the commit works. Follow up question: When I switch thumbnails to and back, the zoom/position resets, is that intentional?
As for the workspace, it is very nifty, but does not quite fit into my software workflow.
You can turn "autocenter" and "autozoom" preferences to "off" and then they won't be invoked when you change images. Change the preference for the "Image" channel and it will be inherited by other channels you create.
Another possibility to "off" is "override". For autozoom setting, setting to override means that it will automatically zoom new images to fit the window until such time that you change the zoom, when it turns itself "off". There is a keyboard shortcut (single quote) to turn it back to "override" should you want to re-enable the autozooming. The same works for "autocuts" (shortcut is semicolon). You can see the status of these in the Info panel. Currently there is no keyboard shortcut for autocenter, but there probably should be.
Back to your question, though, it certainly would be possible to add a feature to match the zoom and pan position across channels. Maybe something to add to the "Channels" menu?
For my purpose, changing these settings in channel_Image.cfg
is just as effective as forcing zoom/pan to match via menu item, so I think the menu feature is currently unnecessary. But if I find otherwise in the future, I will open up a new issue. Thank you for your help!
autocenter = 'override'
autozoom = 'override'
Commit d0e6b9680f17d0c7ae2709b8b09323ddb3c3926b adds back in support for autocuts when the data changes inside an image. Scale (zoom) and pan settings are not affected. This change is due to a user scrolling through slices with MultiDim
and wanting correct "scaling". Since MultiDim
does not set a new image, but simply updates an existing image, autocuts will not be applied to each successive frame without this change.
@pplim, let me know if this is an issue for you. If so, I will probably look at making a solution based on a user preference setting to turn it on and off.
I don't see any problems with this so far. Thanks for the info!
I have a plugin that modifies the displayed image and then re-display the modified array, as follow:
When I have the original image zoomed in (say, 10X centered on a pixel on the top right corner), the display goes back to 1X centered on the entire image when I update the data. Is there a way to tell the display to keep the current zoom and position?