From 741b7c64cd9360ca752c9f2937d550dcd61116ef Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Mon, 12 Sep 2022 18:21:18 -0400 Subject: [PATCH 1/8] Imviz: Alt-click to create single-pixel region --- CHANGES.rst | 2 ++ docs/imviz/displayimages.rst | 24 ++++++++++++++++++++++++ jdaviz/configs/imviz/plugins/viewers.py | 19 ++++++++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 679542fd20..e56fcd1672 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -40,6 +40,8 @@ Imviz - Changing link options now updates immediately without needing to press "Link" button. [#1598] +- Alt-clicking will now create a single-pixel spatial region on the image. [#1647] + Mosviz ^^^^^^ diff --git a/docs/imviz/displayimages.rst b/docs/imviz/displayimages.rst index 258a444c0a..0655bd4e5d 100644 --- a/docs/imviz/displayimages.rst +++ b/docs/imviz/displayimages.rst @@ -145,6 +145,30 @@ You can :ref:`import ` and :ref:`export Date: Tue, 13 Sep 2022 18:25:04 -0400 Subject: [PATCH 2/8] Move implementation to proper tool --- CHANGES.rst | 2 +- docs/imviz/displayimages.rst | 5 ++-- jdaviz/configs/imviz/plugins/tools.py | 30 +++++++++++++++++++++ jdaviz/configs/imviz/plugins/viewers.py | 24 +++-------------- jdaviz/configs/imviz/tests/test_tools.py | 34 +++++++++++++++++++++--- 5 files changed, 69 insertions(+), 26 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index e56fcd1672..21006a51b7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -40,7 +40,7 @@ Imviz - Changing link options now updates immediately without needing to press "Link" button. [#1598] -- Alt-clicking will now create a single-pixel spatial region on the image. [#1647] +- New tool to create a single-pixel spatial region on the image. [#1647] Mosviz ^^^^^^ diff --git a/docs/imviz/displayimages.rst b/docs/imviz/displayimages.rst index 0655bd4e5d..450beb98c0 100644 --- a/docs/imviz/displayimages.rst +++ b/docs/imviz/displayimages.rst @@ -150,8 +150,9 @@ to make subsets visible or invisible, to change their color, and to change their Single-Pixel Selection ---------------------- -In Imviz, you can create a single-pixel spatial region by alt-clicking -on the pixel of interest. +This tool allows the user to create a single-pixel spatial region +in an image viewer. Activate this tool and then left-click to create +the new region. When you have multiple images loaded and linked by WCS (see :ref:`imviz-link-control`), the region defined is with respect to diff --git a/jdaviz/configs/imviz/plugins/tools.py b/jdaviz/configs/imviz/plugins/tools.py index fc6bb9c2cb..7aaf8a1aa1 100644 --- a/jdaviz/configs/imviz/plugins/tools.py +++ b/jdaviz/configs/imviz/plugins/tools.py @@ -205,3 +205,33 @@ def on_mouse_or_key_event(self, data): with delay_callback(state, 'bias', 'contrast'): state.bias = 0.5 state.contrast = 1 + + +@viewer_tool +class SinglePixelRegion(CheckableTool): + + icon = os.path.join(ICON_DIR, 'pixelspectra.svg') # FIXME: Update icon + tool_id = 'jdaviz:singlepixelregion' + action_text = 'Create single-pixel spatial region' + tool_tip = 'Click on the viewer to create single-pixel spatial region' + + def activate(self): + self.viewer.add_event_callback(self.on_mouse_event, events=['click']) + + def deactivate(self): + self.viewer.remove_event_callback(self.on_mouse_event) + + def on_mouse_event(self, data): + import numpy as np + from regions import RectanglePixelRegion, PixCoord + + # Extract data coordinates - these are pixels in the reference image + x = data['domain']['x'] + y = data['domain']['y'] + + # NOTE: We always use the reference image pixel coordinates because + # Subset is defined w.r.t. reference image. + x, y = np.rint([x, y]) + + reg = RectanglePixelRegion(center=PixCoord(x=x, y=y), width=1, height=1) + self.viewer.jdaviz_helper.load_regions(reg) diff --git a/jdaviz/configs/imviz/plugins/viewers.py b/jdaviz/configs/imviz/plugins/viewers.py index 06cdf14139..0a33266747 100644 --- a/jdaviz/configs/imviz/plugins/viewers.py +++ b/jdaviz/configs/imviz/plugins/viewers.py @@ -25,14 +25,15 @@ class ImvizImageView(BqplotImageView, AstrowidgetsImageViewerMixin, JdavizViewer tools = ['jdaviz:homezoom', 'jdaviz:boxzoommatch', 'jdaviz:boxzoom', 'jdaviz:panzoommatch', 'jdaviz:imagepanzoom', 'jdaviz:contrastbias', 'jdaviz:blinkonce', - 'bqplot:rectangle', 'bqplot:circle', 'bqplot:ellipse'] + 'bqplot:rectangle', 'bqplot:circle', 'bqplot:ellipse', 'jdaviz:singlepixelregion'] # categories: zoom resets, zoom, pan, subset, select tools, shortcuts tools_nested = [ ['jdaviz:homezoom', 'jdaviz:prevzoom'], ['jdaviz:boxzoommatch', 'jdaviz:boxzoom'], ['jdaviz:panzoommatch', 'jdaviz:imagepanzoom'], - ['bqplot:circle', 'bqplot:rectangle', 'bqplot:ellipse'], + ['bqplot:circle', 'bqplot:rectangle', 'bqplot:ellipse', + 'jdaviz:singlepixelregion'], ['jdaviz:blinkonce', 'jdaviz:contrastbias'], ['jdaviz:sidebar_plot', 'jdaviz:sidebar_export', 'jdaviz:sidebar_compass'] ] @@ -50,8 +51,7 @@ def __init__(self, *args, **kwargs): self.line_profile_xy = None self.add_event_callback(self.on_mouse_or_key_event, events=['mousemove', 'mouseenter', - 'mouseleave', 'keydown', - 'click']) + 'mouseleave', 'keydown']) self.state.add_callback('x_min', self.on_limits_change) self.state.add_callback('x_max', self.on_limits_change) self.state.add_callback('y_min', self.on_limits_change) @@ -172,22 +172,6 @@ def on_mouse_or_key_event(self, data): self.line_profile_xy.selected_viewer = self.reference_id self.line_profile_xy.vue_draw_plot() - elif data['event'] == 'click' and data['altKey'] is True: - from regions import RectanglePixelRegion, PixCoord - - image = active_layer.layer - - # Extract data coordinates - these are pixels in the reference image - x = data['domain']['x'] - y = data['domain']['y'] - - # NOTE: We always use the reference image pixel coordinates because - # Subset is defined w.r.t. reference image. - x, y = np.rint([x, y]) - - reg = RectanglePixelRegion(center=PixCoord(x=x, y=y), width=1, height=1) - self.jdaviz_helper.load_regions(reg) - def blink_once(self, reversed=False): # Simple blinking of images - this will make it so that only one # layer is visible at a time and cycles through the layers. diff --git a/jdaviz/configs/imviz/tests/test_tools.py b/jdaviz/configs/imviz/tests/test_tools.py index e134338c20..05df5fa39b 100644 --- a/jdaviz/configs/imviz/tests/test_tools.py +++ b/jdaviz/configs/imviz/tests/test_tools.py @@ -1,4 +1,5 @@ import numpy as np +from regions import RectanglePixelRegion from jdaviz.configs.imviz.tests.utils import BaseImviz_WCS_WCS @@ -60,18 +61,45 @@ def test_panzoom_tools(self): t_linkedpan.deactivate() +# We use a new test class to avoid a dirty state from previous test. +class TestSinglePixelRegion(BaseImviz_WCS_WCS): + def test_singlepixelregion(self): + self.imviz.link_data(link_type='wcs') + + t = self.imviz.default_viewer.toolbar_nested.tools['jdaviz:singlepixelregion'] + t.activate() + + # Create a region while viewing reference data. + t.on_mouse_event({'event': 'click', 'domain': {'x': 1, 'y': 2}}) + regions = self.imviz.get_interactive_regions() + assert len(regions) == 1 + reg = regions['Subset 1'] + assert (isinstance(reg, RectanglePixelRegion) and reg.center.x == 1 and reg.center.y == 2 + and reg.width == 1 and reg.height == 1) + + # Create a region while viewing dithered data. + # Region will still be w.r.t. reference data, that is, x and y from domain stay the same. + self.imviz.default_viewer.blink_once() + t.on_mouse_event({'event': 'click', 'domain': {'x': 3, 'y': 4}}) + regions = self.imviz.get_interactive_regions() + assert len(regions) == 2 + reg = regions['Subset 2'] + assert (isinstance(reg, RectanglePixelRegion) and reg.center.x == 3 and reg.center.y == 4 + and reg.width == 1 and reg.height == 1) + + t.deactivate() + + def test_blink(imviz_helper): viewer = imviz_helper.default_viewer for i in range(3): imviz_helper.load_data(np.zeros((2, 2)) + i, data_label=f'image_{i}') - # Last loaded is shown first. So, blinking will take you back to the first one. - # Blink forward. The event will also initialize viewer.label_mouseover . viewer.on_mouse_or_key_event({'event': 'keydown', 'key': 'b', 'domain': {'x': 0, 'y': 0}}) assert viewer.label_mouseover.value == '+0.00000e+00 ' - # Blink forward again and update coordinates info panel. + # Blink forward and update coordinates info panel. viewer.blink_once() viewer.on_mouse_or_key_event({'event': 'mousemove', 'domain': {'x': 0, 'y': 0}}) assert viewer.label_mouseover.value == '+1.00000e+00 ' From fae0f6161e74f24a8943f95e7b932508883e1d07 Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:32:40 -0400 Subject: [PATCH 3/8] Refactor SinglePixelRegion and SpectrumPerSpaxel to share code --- jdaviz/configs/cubeviz/plugins/tools.py | 47 +++++-------------------- jdaviz/configs/imviz/plugins/tools.py | 30 ---------------- jdaviz/core/tools.py | 40 +++++++++++++++++++-- 3 files changed, 46 insertions(+), 71 deletions(-) diff --git a/jdaviz/configs/cubeviz/plugins/tools.py b/jdaviz/configs/cubeviz/plugins/tools.py index 4955fed6b9..f42b6cc037 100644 --- a/jdaviz/configs/cubeviz/plugins/tools.py +++ b/jdaviz/configs/cubeviz/plugins/tools.py @@ -3,12 +3,10 @@ from glue.config import viewer_tool from glue.viewers.common.tool import CheckableTool -from glue.core.roi import RectangularROI -from glue.core.edit_subset_mode import NewMode from jdaviz.configs.imviz.plugins.tools import _MatchedZoomMixin from jdaviz.core.events import SliceToolStateMessage -from jdaviz.core.tools import PanZoom +from jdaviz.core.tools import PanZoom, SinglePixelRegion __all__ = [] @@ -59,49 +57,20 @@ def on_mouse_event(self, data): @viewer_tool -class SpectrumPerSpaxel(CheckableTool): +class SpectrumPerSpaxel(SinglePixelRegion): icon = os.path.join(ICON_DIR, 'pixelspectra.svg') tool_id = 'jdaviz:spectrumperspaxel' action_text = 'See spectrum at a single spaxel' tool_tip = 'Click on the viewer and see the spectrum at that spaxel in the spectrum viewer' - def __init__(self, viewer, **kwargs): - super().__init__(viewer, **kwargs) - - def activate(self): - self.viewer.add_event_callback(self.on_mouse_event, - events=['click']) - - def deactivate(self): - self.viewer.remove_event_callback(self.on_mouse_event) - def on_mouse_event(self, data): - event = data['event'] - - if event == 'click' and data['altKey'] is True: - self.alt_subset_at_spaxel(data) - elif event == 'click': - self.subset_at_spaxel(data) - - def alt_subset_at_spaxel(self, data): - # Add a new subset if the alt key is held down - previous_subset_mode = self.viewer.session.edit_subset_mode.mode - - self.viewer.session.edit_subset_mode.mode = NewMode - self.subset_at_spaxel(data) - self.viewer.session.edit_subset_mode.mode = previous_subset_mode - - def subset_at_spaxel(self, data): x = data['domain']['x'] y = data['domain']['y'] - xmin, xmax, ymin, ymax = self._calc_coords(x, y) - self.viewer.apply_roi(RectangularROI(xmin, xmax, ymin, ymax)) - - def _calc_coords(self, x, y): - xmin = x - 0.5 - xmax = x + 0.5 - ymin = y - 0.5 - ymax = y + 0.5 - return xmin, xmax, ymin, ymax + if data['altKey'] is True: + reg = self.get_subset(x, y, as_roi=False) + self.viewer.jdaviz_helper.load_regions(reg) + else: + roi = self.get_subset(x, y, as_roi=True) + self.viewer.apply_roi(roi) diff --git a/jdaviz/configs/imviz/plugins/tools.py b/jdaviz/configs/imviz/plugins/tools.py index 7aaf8a1aa1..fc6bb9c2cb 100644 --- a/jdaviz/configs/imviz/plugins/tools.py +++ b/jdaviz/configs/imviz/plugins/tools.py @@ -205,33 +205,3 @@ def on_mouse_or_key_event(self, data): with delay_callback(state, 'bias', 'contrast'): state.bias = 0.5 state.contrast = 1 - - -@viewer_tool -class SinglePixelRegion(CheckableTool): - - icon = os.path.join(ICON_DIR, 'pixelspectra.svg') # FIXME: Update icon - tool_id = 'jdaviz:singlepixelregion' - action_text = 'Create single-pixel spatial region' - tool_tip = 'Click on the viewer to create single-pixel spatial region' - - def activate(self): - self.viewer.add_event_callback(self.on_mouse_event, events=['click']) - - def deactivate(self): - self.viewer.remove_event_callback(self.on_mouse_event) - - def on_mouse_event(self, data): - import numpy as np - from regions import RectanglePixelRegion, PixCoord - - # Extract data coordinates - these are pixels in the reference image - x = data['domain']['x'] - y = data['domain']['y'] - - # NOTE: We always use the reference image pixel coordinates because - # Subset is defined w.r.t. reference image. - x, y = np.rint([x, y]) - - reg = RectanglePixelRegion(center=PixCoord(x=x, y=y), width=1, height=1) - self.viewer.jdaviz_helper.load_regions(reg) diff --git a/jdaviz/core/tools.py b/jdaviz/core/tools.py index 0b8cffeac2..bfa338d149 100644 --- a/jdaviz/core/tools.py +++ b/jdaviz/core/tools.py @@ -1,7 +1,7 @@ -import numpy as np import os -from echo import delay_callback +import numpy as np +from echo import delay_callback from glue.config import viewer_tool from glue.core import HubListener from glue.viewers.common.tool import Tool @@ -249,3 +249,39 @@ class SidebarShortcutCompass(_BaseSidebarShortcut): tool_id = 'jdaviz:sidebar_compass' action_text = 'Compass' tool_tip = 'Open compass plugin in sidebar' + + +@viewer_tool +class SinglePixelRegion(CheckableTool): + + icon = os.path.join(ICON_DIR, 'pixelspectra.svg') # FIXME: Update icon + tool_id = 'jdaviz:singlepixelregion' + action_text = 'Create single-pixel spatial region' + tool_tip = 'Click on the viewer to create single-pixel spatial region' + + def activate(self): + self.viewer.add_event_callback(self.on_mouse_event, events=['click']) + + def deactivate(self): + self.viewer.remove_event_callback(self.on_mouse_event) + + def on_mouse_event(self, data): + # Extract data coordinates - these are pixels in the reference image. + # NOTE: We always use the reference image pixel coordinates because + # Subset is defined w.r.t. reference image. + x = data['domain']['x'] + y = data['domain']['y'] + reg = self.get_subset(x, y, as_roi=False) + self.viewer.jdaviz_helper.load_regions(reg) + + def get_subset(self, x, y, as_roi=False): + from regions import RectanglePixelRegion, PixCoord + x, y = np.rint([x, y]) # Center on nearest pixel + reg = RectanglePixelRegion(center=PixCoord(x=x, y=y), width=1, height=1) + + if as_roi: + from jdaviz.core.region_translators import regions2roi + roi = regions2roi(reg) + return roi + + return reg From 385ecf03dccf05ae3888d6c5f701661d80b847e0 Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:57:29 -0400 Subject: [PATCH 4/8] Make Imviz and Cubeviz tool behavior identical --- docs/imviz/displayimages.rst | 7 ++++++- jdaviz/configs/cubeviz/plugins/tools.py | 11 ----------- jdaviz/configs/imviz/tests/test_tools.py | 14 +++++++++++--- jdaviz/core/tools.py | 9 +++++++-- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/docs/imviz/displayimages.rst b/docs/imviz/displayimages.rst index 450beb98c0..d9e7671868 100644 --- a/docs/imviz/displayimages.rst +++ b/docs/imviz/displayimages.rst @@ -152,7 +152,12 @@ Single-Pixel Selection This tool allows the user to create a single-pixel spatial region in an image viewer. Activate this tool and then left-click to create -the new region. +the new region. Click again to move it to a new location under the cursor. +Users can hold down the alt key (Alt key on Windows, Option key on Mac) +while clicking on a pixel to create a new region at that point instead +of moving it. Users can also utilize the different subset modes that are +explained in the :ref:`Spatial Regions ` +section above. When you have multiple images loaded and linked by WCS (see :ref:`imviz-link-control`), the region defined is with respect to diff --git a/jdaviz/configs/cubeviz/plugins/tools.py b/jdaviz/configs/cubeviz/plugins/tools.py index f42b6cc037..6e7ac3a32f 100644 --- a/jdaviz/configs/cubeviz/plugins/tools.py +++ b/jdaviz/configs/cubeviz/plugins/tools.py @@ -63,14 +63,3 @@ class SpectrumPerSpaxel(SinglePixelRegion): tool_id = 'jdaviz:spectrumperspaxel' action_text = 'See spectrum at a single spaxel' tool_tip = 'Click on the viewer and see the spectrum at that spaxel in the spectrum viewer' - - def on_mouse_event(self, data): - x = data['domain']['x'] - y = data['domain']['y'] - - if data['altKey'] is True: - reg = self.get_subset(x, y, as_roi=False) - self.viewer.jdaviz_helper.load_regions(reg) - else: - roi = self.get_subset(x, y, as_roi=True) - self.viewer.apply_roi(roi) diff --git a/jdaviz/configs/imviz/tests/test_tools.py b/jdaviz/configs/imviz/tests/test_tools.py index 05df5fa39b..31a7843f24 100644 --- a/jdaviz/configs/imviz/tests/test_tools.py +++ b/jdaviz/configs/imviz/tests/test_tools.py @@ -70,17 +70,25 @@ def test_singlepixelregion(self): t.activate() # Create a region while viewing reference data. - t.on_mouse_event({'event': 'click', 'domain': {'x': 1, 'y': 2}}) + t.on_mouse_event({'event': 'click', 'altKey': False, 'domain': {'x': 1, 'y': 2}}) regions = self.imviz.get_interactive_regions() assert len(regions) == 1 reg = regions['Subset 1'] assert (isinstance(reg, RectanglePixelRegion) and reg.center.x == 1 and reg.center.y == 2 and reg.width == 1 and reg.height == 1) - # Create a region while viewing dithered data. + # Clicking again will move the region, not creating a new one. + t.on_mouse_event({'event': 'click', 'altKey': False, 'domain': {'x': 2, 'y': 3}}) + regions = self.imviz.get_interactive_regions() + assert len(regions) == 1 + reg = regions['Subset 1'] + assert (isinstance(reg, RectanglePixelRegion) and reg.center.x == 2 and reg.center.y == 3 + and reg.width == 1 and reg.height == 1) + + # Create a new region while viewing dithered data. # Region will still be w.r.t. reference data, that is, x and y from domain stay the same. self.imviz.default_viewer.blink_once() - t.on_mouse_event({'event': 'click', 'domain': {'x': 3, 'y': 4}}) + t.on_mouse_event({'event': 'click', 'altKey': True, 'domain': {'x': 3, 'y': 4}}) regions = self.imviz.get_interactive_regions() assert len(regions) == 2 reg = regions['Subset 2'] diff --git a/jdaviz/core/tools.py b/jdaviz/core/tools.py index bfa338d149..a92449b3d4 100644 --- a/jdaviz/core/tools.py +++ b/jdaviz/core/tools.py @@ -271,8 +271,13 @@ def on_mouse_event(self, data): # Subset is defined w.r.t. reference image. x = data['domain']['x'] y = data['domain']['y'] - reg = self.get_subset(x, y, as_roi=False) - self.viewer.jdaviz_helper.load_regions(reg) + + if data['altKey'] is True: + reg = self.get_subset(x, y, as_roi=False) + self.viewer.jdaviz_helper.load_regions(reg) + else: + roi = self.get_subset(x, y, as_roi=True) + self.viewer.apply_roi(roi) def get_subset(self, x, y, as_roi=False): from regions import RectanglePixelRegion, PixCoord From bef3e55d295022c2e83b5d6811f28eb58719392f Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:05:32 -0400 Subject: [PATCH 5/8] Update single-pixel icon --- jdaviz/core/tools.py | 2 +- jdaviz/data/icons/select_single_pixel.svg | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 jdaviz/data/icons/select_single_pixel.svg diff --git a/jdaviz/core/tools.py b/jdaviz/core/tools.py index a92449b3d4..dfdd7803d4 100644 --- a/jdaviz/core/tools.py +++ b/jdaviz/core/tools.py @@ -254,7 +254,7 @@ class SidebarShortcutCompass(_BaseSidebarShortcut): @viewer_tool class SinglePixelRegion(CheckableTool): - icon = os.path.join(ICON_DIR, 'pixelspectra.svg') # FIXME: Update icon + icon = os.path.join(ICON_DIR, 'select_single_pixel.svg') tool_id = 'jdaviz:singlepixelregion' action_text = 'Create single-pixel spatial region' tool_tip = 'Click on the viewer to create single-pixel spatial region' diff --git a/jdaviz/data/icons/select_single_pixel.svg b/jdaviz/data/icons/select_single_pixel.svg new file mode 100644 index 0000000000..7b31523f12 --- /dev/null +++ b/jdaviz/data/icons/select_single_pixel.svg @@ -0,0 +1 @@ + \ No newline at end of file From a4887989f4a8c4bc28a4a4822271377903499cbf Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Mon, 26 Sep 2022 14:26:31 -0400 Subject: [PATCH 6/8] Update tooltip verbiage --- jdaviz/core/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdaviz/core/tools.py b/jdaviz/core/tools.py index dfdd7803d4..6ba3b8b24f 100644 --- a/jdaviz/core/tools.py +++ b/jdaviz/core/tools.py @@ -257,7 +257,7 @@ class SinglePixelRegion(CheckableTool): icon = os.path.join(ICON_DIR, 'select_single_pixel.svg') tool_id = 'jdaviz:singlepixelregion' action_text = 'Create single-pixel spatial region' - tool_tip = 'Click on the viewer to create single-pixel spatial region' + tool_tip = 'Define a single-pixel spatial region of interest' def activate(self): self.viewer.add_event_callback(self.on_mouse_event, events=['click']) From 268763904e485ccd1cecda6184186ca92b7346f8 Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:48:38 -0400 Subject: [PATCH 7/8] DOC: Improve verbiage. Co-authored-by: Ricky O'Steen <39831871+rosteen@users.noreply.github.com> --- docs/cubeviz/displaycubes.rst | 14 +++++++++----- docs/imviz/displayimages.rst | 14 ++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/cubeviz/displaycubes.rst b/docs/cubeviz/displaycubes.rst index f08fd7dcfb..cfe4b91f08 100644 --- a/docs/cubeviz/displaycubes.rst +++ b/docs/cubeviz/displaycubes.rst @@ -100,11 +100,15 @@ Spectrum At Spaxel ================== This tool allows the user to create a one spaxel subset in an image viewer. This subset will then be -visualized in the spectrum viewer by showing the spectrum at that spaxel. Users can hold down the -alt key (Alt key on Windows, Option key on Mac) while clicking on a spaxel to create a new subset at -that point. Users can then compare spectra at different spaxels using the spectrum viewer. Users can -also utilize the different subset modes that are explained in the -:ref:`Spatial Regions ` section. +visualized in the spectrum viewer by showing the spectrum at that spaxel. +Activate this tool and then left-click to create the new region. +Click again to move the region to a new location under the cursor. Holding down the +alt key (Alt key on Windows, Option key on Mac) while clicking on a spaxel creates a new subset at +that point instead of moving the previously created region. +You can then compare spectra at different spaxels using the spectrum viewer. +You can also use the subset modes that are explained in the +:ref:`Spatial Regions ` +section above in the same way you would with the other subset selection tools. .. _cubeviz-display-settings: diff --git a/docs/imviz/displayimages.rst b/docs/imviz/displayimages.rst index d9e7671868..b203be97b2 100644 --- a/docs/imviz/displayimages.rst +++ b/docs/imviz/displayimages.rst @@ -152,12 +152,14 @@ Single-Pixel Selection This tool allows the user to create a single-pixel spatial region in an image viewer. Activate this tool and then left-click to create -the new region. Click again to move it to a new location under the cursor. -Users can hold down the alt key (Alt key on Windows, Option key on Mac) -while clicking on a pixel to create a new region at that point instead -of moving it. Users can also utilize the different subset modes that are -explained in the :ref:`Spatial Regions ` -section above. +the new region. Click again to move the region to a new location under +the cursor. Holding down the alt key (Alt key on Windows, Option key +on Mac) while clicking pixels creates a new region at each point instead +of moving the previously created region. You can also use the subset +modes that are explained in the +:ref:`Spatial Regions ` +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 From 084e75f47ec2b368d282e5b8bb526aed96378f22 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 29 Sep 2022 16:43:25 -0400 Subject: [PATCH 8/8] Remove sticky comment Co-authored-by: Ricky O'Steen <39831871+rosteen@users.noreply.github.com> --- docs/imviz/displayimages.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/imviz/displayimages.rst b/docs/imviz/displayimages.rst index b203be97b2..48a36318bb 100644 --- a/docs/imviz/displayimages.rst +++ b/docs/imviz/displayimages.rst @@ -164,7 +164,6 @@ tools. When you have multiple images loaded and linked by WCS (see :ref:`imviz-link-control`), the region defined is with respect to the reference image, which might not be the image you are viewing. -This behavior is consistent with glue. .. warning::