Skip to content

Commit

Permalink
fix(ImageResliceMapper): worldToTextureCoordinates transform
Browse files Browse the repository at this point in the history
  • Loading branch information
jadh4v committed Jun 28, 2023
1 parent dd75fd8 commit 33de0d7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Sources/Rendering/OpenGL/ImageResliceMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,9 @@ function vtkOpenGLImageResliceMapper(publicAPI, model) {
// Set the world->texture matrix
if (program.isUniformUsed('WCTCMatrix')) {
const image = model.currentInput;
mat4.identity(model.tmpMat4);
const bounds = image.getBounds();
const sc = [
bounds[1] - bounds[0],
bounds[3] - bounds[2],
bounds[5] - bounds[4],
];
const o = [bounds[0], bounds[2], bounds[4]];
const q = [0, 0, 0, 1];
mat4.fromRotationTranslationScale(model.tmpMat4, q, o, sc);
const dim = image.getDimensions();
mat4.copy(model.tmpMat4, image.getIndexToWorld());
mat4.scale(model.tmpMat4, model.tmpMat4, dim);
mat4.invert(model.tmpMat4, model.tmpMat4);
if (inverseShiftScaleMatrix) {
mat4.multiply(model.tmpMat4, model.tmpMat4, inverseShiftScaleMatrix);
Expand Down

0 comments on commit 33de0d7

Please sign in to comment.