-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
fix(ImageResliceMapper): Axis orthogonality, Image size and texture coordinates #3064
base: master
Are you sure you want to change the base?
Conversation
…ified when using slicePlane
5ad9063
to
a8b7a5c
Compare
@sankhesh can you take a look? |
@@ -1217,7 +1221,14 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) { | |||
); | |||
const otherAxes = [(orthoAxis + 1) % 3, (orthoAxis + 2) % 3].sort(); | |||
const dim = image.getDimensions(); | |||
const ext = [0, dim[0] - 1, 0, dim[1] - 1, 0, dim[2] - 1]; | |||
const ext = [ |
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.
Please use image.getSpatialExtent
here.
@@ -1133,17 +1138,16 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) { | |||
resGeomString = resGeomString.concat(`Plane${slicePlane.getMTime()}`); | |||
if (image) { | |||
resGeomString = resGeomString.concat(`Image${image.getMTime()}`); | |||
// Check to see if we can bypass oblique slicing related bounds computation |
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.
I'm not sure I follow the reason for this change. Firstly, this function will not be called unless there is an input(
vtk-js/Sources/Rendering/OpenGL/ImageResliceMapper/index.js
Lines 121 to 126 in a8b7a5c
if (!model.currentInput) { | |
vtkErrorMacro('No input!'); | |
return; | |
} | |
publicAPI.updateResliceGeometry(); |
const w2io = mat3.fromValues(image?.getDirection());
mat3.fromValues
needs expanded array, the old version would output a matrix full of NaN here.Context
Results
Changes
PR and Code Checklist
npm run reformat
to have correctly formatted codeTesting