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

Reset camera bug when rotation happens on StackViewport #372

Closed
sedghi opened this issue Jan 17, 2023 · 3 comments
Closed

Reset camera bug when rotation happens on StackViewport #372

sedghi opened this issue Jan 17, 2023 · 3 comments
Assignees

Comments

@sedghi
Copy link
Member

sedghi commented Jan 17, 2023

New small bug with latest version : https://www.cornerstonejs.org/live-examples/stackapi

Reproduce via

  • Rotate
  • Flip
  • Reset => does not reset

( note : reset work on rotate, flip, flip + rotate, but not on rotate + flip

funnier : rotate, flip H, flip V, reset : works)

jbocce pushed a commit to jbocce/cornerstone3D-beta that referenced this issue Jan 18, 2023
…happens on StackViewport

For a GPU reset, start by resetting the flips and rotation (via viewUp) because
the ordering of the various flips and rotations that have been applied is not known.
@jbocce jbocce self-assigned this Jan 18, 2023
sedghi pushed a commit that referenced this issue Jan 23, 2023
…ewport (#374)

* fix(StackViewport): #372 Reset camera bug when rotation happens on StackViewport

For a GPU reset, start by resetting the flips and rotation (via viewUp) because
the ordering of the various flips and rotations that have been applied is not known.

* Save the initialViewUp vector so that it can restored in resetCameraGPU.

* Set StackViewport.initialViewUp in the constructor.
@jbocce
Copy link
Contributor

jbocce commented Jan 27, 2023

Another issue found...

rotate + flip + next image is NOT in the correct orientation

@jbocce
Copy link
Contributor

jbocce commented Jan 27, 2023

PR: #388

jbocce pushed a commit to jbocce/cornerstone3D-beta that referenced this issue Feb 2, 2023
…ion and StackViewport.rotationCache properties.

Introduced an IViewport.getRotation for those viewports supporting rotation.
StackViewport.getRotation calculates the rotation from the camera properties.
Changed the StackAPI example to add buttons for constant absolute and delta rotations.
The StackAPI example now reports the current rotation and flips.
sedghi pushed a commit that referenced this issue Feb 6, 2023
* fix(StackViewport): #372 Removed both the Viewport.rotation and StackViewport.rotationCache properties.
Introduced an IViewport.getRotation for those viewports supporting rotation.
StackViewport.getRotation calculates the rotation from the camera properties.
Changed the StackAPI example to add buttons for constant absolute and delta rotations.
The StackAPI example now reports the current rotation and flips.

* Feedback from Alireza:
- use vec3.angle
- added TODO to check with VTK about rounding in rotations
- round the rotation output in the StackAPI exmaple
- some variable renames
@jbocce
Copy link
Contributor

jbocce commented Feb 6, 2023

Various scenarios to test - also try permutations of each:

rotation + flip + next image
rotation + flip + reset
rotation + flip + next image + absolute rotation
rotation + flip + next image + delta rotation
rotation + flip + delta rotation

@jbocce jbocce closed this as completed Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants