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

one-pixel position offset in both x and y directions seen in ds9 image-coordinate region made in ds9 #1138

Closed
kswang1029 opened this issue Jun 27, 2022 · 3 comments · Fixed by #1155
Assignees
Labels
bug Something isn't working

Comments

@kswang1029
Copy link
Contributor

Describe the bug
If we made ds9 regions in ds9 and exported them in image coordinates, the resulting region text file is in 1-based image coordinate. When we load the ds9 region text file in CARTA, it appears that CARTA does not apply an 1-pixel offset per direction in the image coordinates so that we see an one-pixel position offset when the regions are rendered as CARTA's image coordinate system is 0-based.

In the following example, a point ds9 region is defined as
point(289.99796,75.000813) # point=circle
and when it is loaded in CARTA, its image coordinate is
(289.9979553222656, 75.00081634521484) as seen in the region configuration dialog.
It should be (288.9979553222656, 74.00081634521484) instead as CARTA's image coordinate is 0-based.

Screen Shot 2022-06-27 at 11 51 46

To Reproduce
Steps to reproduce the behavior:

  1. Make a ds9 region file like

# Region file format: DS9 version 4.1
global color=green dashlist=8 3 width=4 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
image
point(1.0, 1.0) # point=circle

and load it in CARTA
2. Observe the location of the rendered point region and it is rendered at (1.0, 1.0) in image coordinate. It should be at (0.0, 0,0), the bottom-left corner pixel, instead.

Expected behavior
CARTA would need to convert the 1-based image-coordinate ds9 text region definition to 0-based image-coordinate CARTA region definition.

Platform info (please complete the following information):

  • OS [e.g. macOS Monterey]: macOS Monterey
  • Browser [e.g. chrome, safari, electron app]: chrome
  • Browser version [e.g. 22]: 103
  • Backend branch [e.g. dev, v3b2 release]: dev
  • Frontend branch [e.g. dev, v3b2 release]: dev
@kswang1029 kswang1029 added the bug Something isn't working label Jun 27, 2022
@kswang1029
Copy link
Contributor Author

would be nice to fix this for v3-final if time allows.

@markccchiang markccchiang self-assigned this Jul 19, 2022
@markccchiang
Copy link
Contributor

@kswang1029 Should we transfer to 1-based image coordinate when CARTA exports ds9 regions as pixel coordinates?

@kswang1029
Copy link
Contributor Author

@kswang1029 Should we transfer to 1-based image coordinate when CARTA exports ds9 regions as pixel coordinates?

@markccchiang yes! this would have best compatibilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants