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

Update rotation handling to include absolute and relative rotations, #71

Merged
merged 17 commits into from
Nov 11, 2019

Conversation

mix3d
Copy link
Contributor

@mix3d mix3d commented Nov 7, 2019

Refactor out uneeded / duplicate code from interactors,
Rename volumeMapper -> volumeActor and change associations, so it's always the actor (rather than wishy washy nonsense)

@mix3d
Copy link
Contributor Author

mix3d commented Nov 7, 2019

Should probably update the package.json to include commitizen stuff, I couldn't get it to work, so my commit log is probably "incorrect"

const _viewUp = [...viewUp];

if (model.volumeMapper) {
let volumeCoordinateSpace = vec9toMat3([1, 0, 0, 0, 1, 0, 0, 0, 1]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since you're now using an identity matrix here, might as well remove the whole volumeCoordinateSpace math altogether. We did in our project.

@dannyrb dannyrb requested a review from JamesAPetts November 7, 2019 17:58
@dannyrb
Copy link
Member

dannyrb commented Nov 7, 2019

CC: @JamesAPetts

@mix3d
Copy link
Contributor Author

mix3d commented Nov 7, 2019

Also to note: The current rotation does not support screen-space z-Axis rotations ( rotate 90 degrees ), which we also need. Perhaps hold off until I can add that into the function, which WAS in my code that the current logic was cribbed from. /shrug

@JamesAPetts
Copy link
Member

Perhaps hold off until I can add that into the function

I can look at this again when you are ready ^.

For now I've had a look through and generally agree with the approach. One issues is that setting the View2D's orientation through the orientation prop no longer works, check the crosshairs example.

Its probably a very minor issue with the refactor, would you be able to check + fix that?

Cheers.

@mix3d
Copy link
Contributor Author

mix3d commented Nov 10, 2019

Fixed. Also realized that the existing logic for onScroll callbacks was wrong, but my code (which uses the stack scroll CB for the axis location updating) was working right; turned out it worked because it wasn't CALLING the getter, but just checking the variable itself, which would always be falsy, never ran the callback. (and none of the React code uses the callback anyways)

@JamesAPetts
Copy link
Member

Thanks a lot for all of this!

(and none of the React code uses the callback anyways)

We are using it in OHIF, let me check it works there.

@JamesAPetts
Copy link
Member

Checked all works in OHIF, and also tested that it doesn't break some future unmerged changes for multi-volume rendering.

This is a step in the right direction and also allows us to prevent too much hardforking between the react and vue versions.

Super thankful! Thanks :)

@JamesAPetts JamesAPetts merged commit 7710284 into OHIF:master Nov 11, 2019
Copy link
Member

@JamesAPetts JamesAPetts left a comment

Choose a reason for hiding this comment

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

LGTM.

@ohif-bot
Copy link
Member

🎉 This PR is included in version 0.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants