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

ENH: Image rotation via WCS-only layers #2179

Merged
merged 156 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
3d987a6
Adding API for WCS-only layers for glue-based image rotation
bmorris3 May 3, 2023
f9ea336
style fixes
bmorris3 May 3, 2023
d6dec97
adapting improvements to work in other helpers
bmorris3 May 3, 2023
72a2dfd
more general change refdata method
bmorris3 May 8, 2023
91930b7
some test coverage for wcs-based rotation via glue
bmorris3 May 10, 2023
e20be3d
Proposed changes for PR 2179 (ENH: Image rotation via WCS-only layers…
pllim May 22, 2023
3ff8e58
click data menu items to set as refdata
bmorris3 May 26, 2023
072b79a
using badge to note refdata in dropdown
bmorris3 May 31, 2023
dfe7853
only add refdata tooltip for imviz, remove refdata references in tooltip
bmorris3 Jun 13, 2023
d59313d
tooltip improvements
bmorris3 Jun 13, 2023
cea7fef
only show pointer cursor in imviz
bmorris3 Jun 13, 2023
5ac72e8
working towards default wcs base layer
bmorris3 Jun 23, 2023
c11c03b
wcs linking requires wcs-only base layer
bmorris3 Jun 28, 2023
5b2261c
click data menu items to set as refdata
bmorris3 May 26, 2023
4197efc
add data menu orientation options, handle linking changes
bmorris3 Jul 7, 2023
9c55f80
fixing pixel scale calculation for gwcs w/ Roman
bmorris3 Jul 10, 2023
7585618
refdata choice unavailable bugfix, better wcs fallbacks
bmorris3 Jul 11, 2023
acad297
hide wcs-only layers from plugin dataset selectors
bmorris3 Jul 11, 2023
a73bf49
making refdata selection specific to each viewer
bmorris3 Jul 12, 2023
982c584
fix for subset support
bmorris3 Jul 12, 2023
25756d1
only match zoom level in viewers with common refdata
bmorris3 Jul 12, 2023
07fbcf8
reorganizing features in vue for links plugin
bmorris3 Jul 12, 2023
e9dbbb7
adapting assumptions in tests for wcs-only layer implementation
bmorris3 Jul 14, 2023
9e53da0
UI revisions
bmorris3 Jul 18, 2023
eb12c1b
ensuring wcs-only layers are centered near original dataset
bmorris3 Jul 19, 2023
563e057
support batch loading wcs-only layers
bmorris3 Jul 20, 2023
b428814
adding concept notebook
bmorris3 Jul 20, 2023
3cffbcb
bugfix when creating but not setting nu-el or nu-er orientations
bmorris3 Jul 20, 2023
f6341a5
Update jdaviz/configs/imviz/plugins/links_control/links_control.vue
bmorris3 Jul 27, 2023
70e47bb
implementing review comments from Kyle
bmorris3 Aug 2, 2023
8e009d9
debugging commit for Kyle
bmorris3 Aug 2, 2023
15d4997
specify rotation_angle traitlet as FloatHandleEmpty
bmorris3 Aug 2, 2023
c7a84b7
adding default to pixel scale ratio [ci skip]
bmorris3 Aug 3, 2023
60a589a
changelog update
bmorris3 Aug 4, 2023
26d8af0
improve match between refdata sky area and wcs-only layer
bmorris3 Aug 8, 2023
0ff21da
fixes for tests in image rotation
bmorris3 Sep 12, 2023
af7e91e
Remove unused method and callback hook.
pllim Sep 18, 2023
198f956
DatasetSelect compatibility fix for wcs-only layers
bmorris3 Sep 18, 2023
c7e5b99
Remove imviz_rotation_by_hidden_layer.ipynb
pllim Sep 18, 2023
0450d69
Update notebooks/concepts/imviz-wcs-rotation.ipynb
bmorris3 Sep 21, 2023
22c4b33
Update notebooks/concepts/imviz-wcs-rotation.ipynb
bmorris3 Sep 21, 2023
940395e
plugin warning when subsets exist on refdata change, error raised via…
bmorris3 Sep 18, 2023
06815ce
incorporate review comments from Kyle
bmorris3 Sep 22, 2023
75444b5
bugfixes: compass compat, change refdata to data layer on pixel linking
bmorris3 Sep 26, 2023
3862d19
Fix data deletion tests for image rotation
bmorris3 Oct 25, 2023
9a7f448
better Imviz handling w/o WCS when WCS-linked
bmorris3 Sep 18, 2023
27256dd
better viewer zoom/center sync with different refdata
bmorris3 Oct 16, 2023
8c2eab3
Add warning when less than 2 data do not have WCS
javerbukh Oct 26, 2023
828c8c9
Move warning message and fix padding
javerbukh Oct 26, 2023
a99db8e
Update jdaviz/configs/imviz/plugins/links_control/links_control.py
javerbukh Oct 26, 2023
f3dcc43
Apply suggestions from code review
javerbukh Nov 1, 2023
f0099df
Address all review comments
javerbukh Nov 1, 2023
f826141
Only have warning when no data with wcs are present
javerbukh Nov 2, 2023
91945a4
Use return instead of break
javerbukh Nov 3, 2023
622ab4d
Fix to work with one data with wcs
javerbukh Nov 3, 2023
2c62df5
move orientation layers out of expandable menu
kecnry Oct 26, 2023
ba46c67
fix legend margin by moving badge logic within data-menu
kecnry Oct 26, 2023
a736b91
simplify data-menu logic
kecnry Oct 30, 2023
244e94b
do not allow re-adding non-wcs data while wcs-linked
kecnry Oct 30, 2023
77539df
improve tooltip/alignment for trash icon in orientation layers
kecnry Oct 30, 2023
bdefcab
don't re-add layers that were intentionally removed
kecnry Nov 1, 2023
60acf60
don't allow deleting "Default orientation" from data-menu
kecnry Nov 1, 2023
57de3a2
fix updating default viewer menu on change in link type
kecnry Nov 2, 2023
27a2608
fix updating viewer_item for all viewers
kecnry Nov 2, 2023
2f08268
fix codestyle error introduced in rebase
kecnry Nov 3, 2023
83787b0
consolidate has_wcs logic
kecnry Nov 3, 2023
db8de5d
remove redundant lines setting refdata label
kecnry Nov 3, 2023
9c6517d
bugfixes for image rotation
bmorris3 Nov 9, 2023
240e25b
convert marker location from previous to new WCS when ref data changed
kecnry Nov 3, 2023
769830b
app._link_type set on init to pixels
kecnry Nov 7, 2023
9edf350
marker to stick to location for wcs>pixel linking
kecnry Nov 7, 2023
c6413dc
marker visibility based on whether data is loaded in viewer
kecnry Nov 7, 2023
5fbce37
remove orientation layers from mouseover cycler
kecnry Nov 7, 2023
579b557
fix case original viewer reference WCS fails to convert to pixels
kecnry Nov 8, 2023
e941d97
retain behavior only showing markers in viewer where they were created
kecnry Nov 8, 2023
d2d5e83
drop markers on removing layer when reference data mapping fails
kecnry Nov 8, 2023
4e5430e
world_to_pixel compat with both fits and gwcs
kecnry Nov 8, 2023
4c9482e
(partial) support for markers added as pixel coords only
kecnry Nov 9, 2023
31307ba
skip recomputing locations for configs without world/pixel info
kecnry Nov 9, 2023
e00020f
warning in links_control when markers are present
kecnry Nov 10, 2023
557b62b
move markers warnings above orientation layer section in plugin
kecnry Nov 10, 2023
f1f4e1c
fix traitlet name change in tests
kecnry Nov 10, 2023
920f770
code cleanup
kecnry Nov 10, 2023
769614e
orientation plugin UI/UX changes
kecnry Nov 14, 2023
59963da
consistent styling for alerts
kecnry Nov 15, 2023
b5ad653
update orientation icons and data-menu styling
kecnry Nov 15, 2023
80ca66e
improved v-alert styling in plugins
kecnry Nov 15, 2023
981e1f5
update internal references to "Links Control"
kecnry Nov 15, 2023
fc747bb
code cleanup
kecnry Nov 15, 2023
e68e409
address any other possible places for wcs case-confusion
kecnry Nov 15, 2023
5cd1cfe
temporarily revert defaulting to aligned by WCS
kecnry Nov 15, 2023
f63f2ba
codestyle
kecnry Nov 15, 2023
0ee9a74
remove unused tests
kecnry Nov 15, 2023
0373852
or -> orientation in notebook
kecnry Nov 16, 2023
c6bc1ea
deprecate canvas rotation
kecnry Jul 28, 2023
632f15b
consolidate deprecation handling of Links Control and Canvas Rotation
kecnry Nov 27, 2023
9ac511d
update references from Links Control -> Orientation
kecnry Nov 27, 2023
8d698a0
WIP: Fix astrowidgets API
pllim Nov 15, 2023
2df2315
Fix rebase weirdness maybe
pllim Nov 29, 2023
7337992
We do not need the concept notebook anymore
pllim Nov 29, 2023
96c64fd
Revert removal of linked pan/zoom new code.
pllim Nov 29, 2023
c5d9956
Fix astrowidgets markers.
pllim Nov 29, 2023
3fb40cb
clean up linked pan/zoom code
pllim Nov 30, 2023
f846f18
Fix change log
pllim Nov 30, 2023
e1e6d55
Privatize link_image_data because it is breaky
pllim Dec 1, 2023
2eb4d6a
Fix linked pan/zoom again
pllim Dec 1, 2023
00e6709
Let's hope for the best
pllim Dec 1, 2023
a9c3887
Ensure subsets are not visible on WCS-only layers
bmorris3 Nov 30, 2023
68bdada
Update jdaviz/configs/imviz/plugins/orientation/orientation.py
bmorris3 Nov 30, 2023
409ebbf
Update jdaviz/core/template_mixin.py
bmorris3 Nov 30, 2023
5ed976a
applying changes
cshanahan1 Nov 15, 2023
1ff1db9
fixed one failing test
cshanahan1 Dec 4, 2023
9c9317b
fixed other failing subset test
cshanahan1 Dec 4, 2023
775f94f
fix aper phot test
cshanahan1 Dec 4, 2023
c4cd4b6
code style
cshanahan1 Dec 4, 2023
3c632c7
review changes
cshanahan1 Dec 4, 2023
32aca57
fix test
cshanahan1 Dec 5, 2023
906632c
.;
cshanahan1 Dec 5, 2023
1fe4829
modified subset centroid test
cshanahan1 Dec 7, 2023
ae7d77d
Update test_subset_centroid.py
bmorris3 Dec 7, 2023
dbbbd49
fix failures after rebase
bmorris3 Dec 7, 2023
d1c264f
rename links control to orientation in docs
bmorris3 Dec 7, 2023
d34b4cb
Merge pull request #2589 from pllim/fix-ann-reg-test
pllim Dec 6, 2023
26f5e13
Clare changes review as more changes
pllim Dec 8, 2023
7719a71
get_interactive_regions returns sky region
pllim Dec 8, 2023
0394eb4
Fix changelog caused by rebase
pllim Dec 8, 2023
95ffdcf
Remove unnecessary link_type.lower() calls
pllim Dec 9, 2023
2525060
f-string not recommended for logger
pllim Dec 9, 2023
f8dee5e
Update docs/imviz/plugins.rst
bmorris3 Dec 11, 2023
2541eb3
image rotation fixes for multiple viewers
bmorris3 Dec 11, 2023
1a9ab01
Update jdaviz/app.py
bmorris3 Dec 12, 2023
3e32cfd
Update jdaviz/app.py
bmorris3 Dec 12, 2023
a66e7a0
Update jdaviz/app.py
bmorris3 Dec 12, 2023
9d7657f
fix case without refdata
bmorris3 Dec 13, 2023
222b10c
fixes (lots and lots)
bmorris3 Dec 13, 2023
0da9137
handling case for viewers without data
bmorris3 Dec 14, 2023
ed8bde5
Update jdaviz/core/tools.py
bmorris3 Dec 14, 2023
ad2bf7a
fix matched pan zoom
bmorris3 Jan 2, 2024
9cfff35
Update jdaviz/configs/imviz/plugins/orientation/orientation.py
bmorris3 Jan 5, 2024
6ca8ed6
Update jdaviz/configs/imviz/plugins/orientation/orientation.py
bmorris3 Jan 5, 2024
75861e6
Update jdaviz/configs/imviz/plugins/orientation/orientation.py
bmorris3 Jan 5, 2024
2783137
fixes from github suggestions
bmorris3 Jan 5, 2024
5dcd157
review comments from Kyle
bmorris3 Jan 12, 2024
7804354
fix centering on click test
bmorris3 Jan 12, 2024
a4faf58
reducing redundancy
bmorris3 Jan 12, 2024
4e5679d
add warning to astrowidgets_api zoom_level
bmorris3 Jan 12, 2024
df1cd7f
data menu whac-a-mole fixes
bmorris3 Jan 16, 2024
ab16da9
Update jdaviz/core/astrowidgets_api.py
bmorris3 Jan 16, 2024
0659c12
fix rebase error
bmorris3 Jan 17, 2024
709a2f7
DOC: Fix warning indentation
pllim Jan 17, 2024
789ea0c
DOC: zoom method also breaks in WCS linking
pllim Jan 18, 2024
412422b
Apply suggestions from code review
bmorris3 Jan 18, 2024
d3f405c
repairing bad rebase which undid part of #2580
bmorris3 Jan 22, 2024
d19d0de
repairing bad rebase which undid part of #2409
bmorris3 Jan 22, 2024
beff6b7
Merge branch 'main' into wcs-only-layers
pllim Jan 23, 2024
414b632
fix for wcs-only layers appearing in plot options
bmorris3 Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ New Features

Cubeviz
^^^^^^^

- Calculated moments can now be output in velocity units. [#2584, #2588, #2665]

- Added functionality to Collapse and Spectral Extraction plugins to save results to FITS file. [#2586]
Expand All @@ -24,6 +25,9 @@ Cubeviz
Imviz
^^^^^

- There is now option for image rotation in Orientation (was Links Control) plugin.
This feature requires WCS linking. [#2179]

Mosviz
^^^^^^

Expand All @@ -48,6 +52,16 @@ Cubeviz
Imviz
^^^^^

- Links Control plugin is now called Orientation. [#2179]

- Linking by WCS will now always generate a hidden reference data layer
without distortion. As a result, when WCS linked, the first loaded data
is no longer the reference data. Additionally, if data is distorted,
its distortion will show when linked by WCS. If there is also data without WCS,
it can no longer be displayed when WCS linked. [#2179]

- ``imviz.link_data()`` inputs and behaviors are now consistent with the Orientation plugin. [#2179]

Mosviz
^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions docs/imviz/displayimages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Pan/Zoom and Linked Pan/Zoom
Linked Pan/Zoom is an Imviz-specific feature enabled only when there are multiple viewers that
allows the user to pan and zoom images in multiple different viewers simultaneously. This works by matching images
based on the way they are linked together. Images are linked by pixels on load time,
but you can re-link them via WCS using :ref:`imviz-link-control`.
but you can re-link them via WCS using :ref:`imviz-orientation`.

Single-viewer Pan/Zoom is also available and is used in a similar way as in
other Jdaviz tools. To access this option when there are multiple viewers, right-click on the
Expand Down Expand Up @@ -216,7 +216,7 @@ section above in the same way you would with the other subset selection
tools.

When you have multiple images loaded and linked by WCS
(see :ref:`imviz-link-control`), the region defined is with respect to
(see :ref:`imviz-orientation`), the region defined is with respect to
the reference image, which might not be the image you are viewing.

.. warning::
Expand Down
40 changes: 35 additions & 5 deletions docs/imviz/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ To export the table into the notebook via the API, call
:meth:`~jdaviz.core.template_mixin.TableMixin.export_table`
(see :ref:`plugin-apis`).

.. _imviz-link-control:
.. _imviz-orientation:

Link Control
============
Orientation
===========

.. note::

This plugin is used to re-link images by pixels or WCS using
:func:`~jdaviz.configs.imviz.helper.link_image_data`.
This plugin was previous called "Links Control".

This plugin is used to align image layers by pixels or sky (WCS).
All images are automatically linked by pixels on load but you can use
it to re-link by pixels or WCS as needed.

Expand All @@ -115,6 +118,13 @@ performant at the cost of accuracy but should be accurate to within a pixel
for most cases. If approximation fails, WCS linking still automatically
falls back to full transformation.

Since Jdaviz v3.9, when linking by WCS, a hidden reference data layer
without distortion (labeled "Default orientation") will be created and all the data would be linked to
it instead of the first loaded data. As a result, working in pixel
space when linked by WCS is not recommended. Additionally, any data
with distorted WCS would show as distorted on the display. Furthermore,
any data without WCS can no longer be shown in WCS linking mode.

For the best experience, it is recommended that you decide what kind of
link you want and set it at the beginning of your Imviz session,
rather than later.
Expand All @@ -130,6 +140,21 @@ From the API within the Jupyter notebook (if linking by WCS):

imviz.link_data(link_type='wcs')

.. _imviz-orientation-rotation:

Orientation: Image Rotation
===========================

When linked by WCS, sky rotation is also possible. You can choose from
presets (N-up, E-left/right) or provide your own sky angle.

.. warning::

Each rotation request created a new reference data layer in the background.
Just as in :ref:`imviz-import-data`, the performance would be impacted by
the number of active rotation layers you have; Only keep the desired rotation layer.
Note that the "default orientation" layer cannot be removed.

.. _imviz-compass:

Compass
Expand Down Expand Up @@ -348,6 +373,11 @@ To import a regions file or object from the API:
Canvas Rotation
===============

.. note::

This plugin is deprecated in favor of rotation via :ref:`imviz-orientation` and will be removed
in a future release.

The canvas rotation plugin allows rotating and horizontally flipping the image to any arbitrary
value by rotating the canvas axes themselves. Note that this does not affect the underlying data, and
exporting data to the notebook via the API will therefore not exhibit the same rotation.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/api_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Plugins API
.. automodapi:: jdaviz.configs.imviz.plugins.line_profile_xy.line_profile_xy
:no-inheritance-diagram:

.. automodapi:: jdaviz.configs.imviz.plugins.links_control.links_control
.. automodapi:: jdaviz.configs.imviz.plugins.orientation.orientation
:no-inheritance-diagram:

.. automodapi:: jdaviz.configs.imviz.plugins.rotate_canvas.rotate_canvas
Expand Down
Loading