From c821e1c19b29bb252dcbe5f614c5e0febbc81f70 Mon Sep 17 00:00:00 2001 From: treattrick <1154174767@qq.com> Date: Wed, 13 May 2026 22:49:32 +0800 Subject: [PATCH] fix(vtkOpenGLImageCPRMapper): projectionScaledDirection should have vtkImageData direction matrix --- Sources/Rendering/OpenGL/ImageCPRMapper/index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Sources/Rendering/OpenGL/ImageCPRMapper/index.js b/Sources/Rendering/OpenGL/ImageCPRMapper/index.js index 3e74f73796b..bc5247ef5c9 100644 --- a/Sources/Rendering/OpenGL/ImageCPRMapper/index.js +++ b/Sources/Rendering/OpenGL/ImageCPRMapper/index.js @@ -773,7 +773,6 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) { ]; if (useProjection) { tcoordFSDec.push( - 'uniform vec3 volumeSizeMC;', 'uniform int projectionSlabNumberOfSamples;', 'uniform float projectionConstantOffset;', 'uniform float projectionStepLength;' @@ -930,7 +929,7 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) { // Loop on all the samples of the projection tcoordFSImpl.push( - 'vec3 projectionScaledDirection = projectionDirection / volumeSizeMC;', + 'vec3 projectionScaledDirection = (MCTCMatrix * vec4(projectionDirection, 0.0)).xyz;', 'vec3 projectionStep = projectionStepLength * projectionScaledDirection;', 'vec3 projectionStartPosition = volumePosTC + projectionConstantOffset * projectionScaledDirection;', 'vec4 tvalue = initialProjectionTextureValue;', @@ -1199,16 +1198,11 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) { } // Projection uniforms if (model.renderable.isProjectionEnabled()) { - const image = model.currentImageDataInput; - const spacing = image.getSpacing(); - const dimensions = image.getDimensions(); const projectionSlabThickness = model.renderable.getProjectionSlabThickness(); const projectionSlabNumberOfSamples = model.renderable.getProjectionSlabNumberOfSamples(); - const volumeSize = vec3.mul([], spacing, dimensions); - program.setUniform3fArray('volumeSizeMC', volumeSize); program.setUniformi( 'projectionSlabNumberOfSamples', projectionSlabNumberOfSamples