-
Notifications
You must be signed in to change notification settings - Fork 453
[WIP - DONT MERGE] fix(fov): fov was not working correctly for other planes #2334
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
base: main
Are you sure you want to change the base?
Conversation
sedghi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable
|
This fix seems to break the stack viewports in many cases, and I am not sure if it would work for volumes with oblique orientation. Using the legacy FOV calculation method for volume viewports could possibly be a quick fix: |
Yeah this is broken thats why we changed the title to WIP. We could do legacy for Volume viewport but I believe it still doesn't always make the image take the full canvas. I'm leaving it up until we figure out something consistent |
|
That's definitely true. Using the legacy scaling as fallback might still make sense for the interim time because the current release version is often cropping a significant number of slices in volume viewports (thus, the legacy scaling should be preferable - even if not perfect). |
|
can you send us some screenshots of how much is it missing? |
|
I think this is related issue #2168 |
|
@IbrahimCSAE - can you tell me exactly how to reproduce the issue in this PR? I've tweaked the PR to just compute the delta between your method and the current method and I'm see differences of less than 0.0001 |
|
@wayfarer3130 i remember the neptune study in MPR showed the issue regarding initial fov of reconstruction views |
I don’t have clean repro steps beyond what Tobias originally reported, and it’s been a while since I last dug into this. I agree the delta you’re seeing is tiny. What I’m proposing is to keep the old FOV logic for volume viewports, and keep the current/improved logic for stack viewports, so we don’t regress the stack behavior. This is what I was proposing (and what @tblock79 also suggested): if (imageData && viewport instanceof StackViewport) {
const extent = imageData.getExtent();
const spacing = imageData.getSpacing();
widthWorld = (extent[1] - extent[0]) * spacing[0];
heightWorld = (extent[3] - extent[2]) * spacing[1];
} else {
({ widthWorld, heightWorld } = this._getWorldDistanceViewUpAndViewRight(
bounds,
viewUp,
viewPlaneNormal
));
}That way we don’t lose the improved FOV behavior for stack viewports, while restoring volume viewports to the old behavior. |

Context
The old code was not determining correctly which extent dimensions to use based on the view plane normal, now its fixed to use: