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

Kuanchou/681 relative coordinates #2370

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

loveluthien
Copy link
Collaborator

@loveluthien loveluthien commented Apr 21, 2024

Description

This PR closes #681 adding an offset coordinates. The offset coordinates consider the projection. We can turn on the offset coordinates using overlay coordinates in the toolbar or the image view setting. The default offset center is the image center and can be customized by setting it to the view center or a manual input. The unit of delta angles changes with the field of view size.

Due to the offset mapping using AST which changes the projection center, the distance measurement went wrong when applying the offset coordinates. Therefore, we replace the distance measurement with the ruler annotation which is not affected by the overlay coordinates.

Checklist

  • coordinates show delta angles.
  • UI: toolbar and image view setting panel.
  • distance measurement is replaced with ruler annotation.

For linked issues (if there are):

  • assignee and label added
  • GitHub Project estimate added

For the pull request:

  • reviewers and assignee added
  • GitHub Project estimate added
  • changelog updated / no changelog update needed
  • unit test added (for functions with no dependenies)
  • API documentation added (for public variables and methods in stores)

For dependencies:

  • e2e test passing / corresponding fix added / new e2e test created
  • protobuf version bumped / no protobuf version bumped needed
  • protobuf updated to the latest dev commit / no protobuf update needed
  • corresponding ICD test fix added (BackendService changed) / no ICD test fix needed (BackendService unchanged)
  • user manual prepared (for large new features)

@loveluthien loveluthien added the awaiting code changes For pull requests that require code changes label Apr 30, 2024
@loveluthien loveluthien added this to the v5.0-beta milestone Apr 30, 2024
@loveluthien
Copy link
Collaborator Author

@kswang1029 @crocka There is a discussion item. The distance measurement fails when using a relative coordinate, more precisely after applying an AST shifted map. The easiest way is to replace the distance measurement with the ruler annotation. @YuHsuan-Hwang has some concerns about doing that. What's your opinion?

@kswang1029
Copy link
Collaborator

Do you mean we deprecate the distance measurement tool and ask users to use the rule annotation instead? If so, I am fine with the idea which actually enables multiple measurements and users can see all the results at the same time.

@loveluthien
Copy link
Collaborator Author

Yes. I feel the ruler is more useful than the distance measurement.

@YuHsuan-Hwang
Copy link
Collaborator

I'm ok with deprecating the distance measuring tool.

@loveluthien loveluthien added awaiting code review For pull requests that require code review awaiting testing For pull requests that require testing and removed awaiting code changes For pull requests that require code changes labels May 8, 2024
@loveluthien loveluthien marked this pull request as ready for review May 8, 2024 08:54
@loveluthien loveluthien added awaiting code changes For pull requests that require code changes and removed awaiting code review For pull requests that require code review awaiting testing For pull requests that require testing labels May 8, 2024
@loveluthien loveluthien added awaiting code review For pull requests that require code review and removed awaiting code changes For pull requests that require code changes labels May 14, 2024
@loveluthien loveluthien added the awaiting testing For pull requests that require testing label May 14, 2024
Copy link
Collaborator

@kswang1029 kswang1029 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks very nice! A corresponding fix is applied to an e2e test branch. New tests will be added asap.

@kswang1029 kswang1029 removed the awaiting testing For pull requests that require testing label May 22, 2024
Copy link
Collaborator

@YuHsuan-Hwang YuHsuan-Hwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks nice. The removal of distance measuring is also good.
Minor comments only:

src/components/ImageView/Toolbar/ToolbarComponent.tsx Outdated Show resolved Hide resolved
src/stores/Frame/FrameStore.ts Outdated Show resolved Hide resolved
if (isPVImage)
{
double corner[] = {xtran[1], ytran[0]};
plotDistText(wcsinfo, plot, start, corner);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like function plotDistText could be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might old version. I had removed entire if (showCurve) section.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I meant the function plotDistText itself in this file could be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I got it.

src/stores/Frame/FrameStore.ts Outdated Show resolved Hide resolved
src/stores/Frame/FrameStore.ts Outdated Show resolved Hide resolved
@kswang1029
Copy link
Collaborator

UPDATE: Added a corresponding e2e test which checks AST grid rendering including the offset cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting code review For pull requests that require code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

relative coordinates to a given point
3 participants