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

LIMS-1569: Get image viewer rings from dials if possible #875

Conversation

ndg63276
Copy link
Collaborator

@ndg63276 ndg63276 commented Dec 4, 2024

JIRA ticket: LIMS-1569
JIRA ticket: LIMS-507

Summary:

Instead of Synchweb drawing fixed circles to show resolution or ice rings, ask the dials rest service to do it for you. Fall back to old method if $dials_rest_url not set.

Changes:

  • Make $dials_rest_url available to frontend
  • If $dials_rest_url is set, ask the backend for resolution or ice rings, else continue drawing them in JS
  • Pass request for resolution or ice rings to dials rest service (and cache images)
  • Fix bug where invert checkbox only worked some of the time

To test:

  • Set $dials_rest_url and $dials_rest_jwt to the same as prod
  • Go to a recent i03 visit (eg the commissioning visit) so images are still on disk, go to a data collection and click on the diffraction image to enlarge it, check the image appears
  • Turn on resolution rings, check 5 rings appear in red. Turn on ice rings, check various rings appear in blue. Turn on both and check both appear.
  • Check once they have been loaded, the images appear more quickly as they are cached on the server
  • Go to an i19-1 visit and find a data collection with a non-zero value for 2 theta. Repeat the above checks, the rings should now be offset and no longer perfectly circular
  • Go to an i23 visit and find a recent data collection. Repeat the above checks, the rings should appear 'squashed' (see LIMS-507)
  • Check turning "invert" on and off works as expected
  • Unset $dials_rest_url and redo the checks on the i03 visit (use a different data collection to avoid caching). Circles should now be drawn by the front end. They will not be accurate for i19-1/i23 visits.

@gfrn
Copy link
Collaborator

gfrn commented Dec 10, 2024

Enabling invert before toggling resolution/ice rings negates the value of the invert checkbox

E.g.: If you toggle "invert", then "ice rings", the image is no longer inverted. Unchecking "invert" then inverts the image

Is this expected behaviour?

@ndg63276
Copy link
Collaborator Author

Enabling invert before toggling resolution/ice rings negates the value of the invert checkbox

E.g.: If you toggle "invert", then "ice rings", the image is no longer inverted. Unchecking "invert" then inverts the image

Is this expected behaviour?

Nope, that's a bug.

It seems very hard to get the image to load and then invert, they seem to race each other. So I have compromised that any time a new image is loaded (add rings, adding threshold, changing image number), the inversion checkbox will be unchecked, so at least the checkbox matches the image displayed.

@ndg63276 ndg63276 changed the base branch from master to pre-release/2024-R5.4 December 16, 2024 14:24
@ndg63276 ndg63276 merged commit 4b57ba2 into pre-release/2024-R5.4 Dec 16, 2024
2 checks passed
@ndg63276 ndg63276 deleted the improvement/LIMS-1569/get-image-viewer-rings-from-dials branch December 16, 2024 14:32
ndg63276 added a commit that referenced this pull request Jan 10, 2025
* LIMS-1569: Get image viewer rings from dials if possible (#875)

* LIMS-1002: Fix error when creating new laboratory (#815)

* LIMS-1302 - add visit to container even if UAS fails (#762)

* LIMS-1487: Fix alphafold triggering (#866)

* LIMS-1563 - Remove touchscreen app (#867)

Co-authored-by: Mark Williams <[email protected]>
Co-authored-by: Guilherme Francisco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants