Skip to content

Commit 7bfb552

Browse files
TreatTrickfinetjul
authored andcommitted
fix(vtkOpenGLImageCPRMapper): projectionScaledDirection should have vtkImageData direction matrix
1 parent 470034d commit 7bfb552

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

  • Sources/Rendering/OpenGL/ImageCPRMapper

Sources/Rendering/OpenGL/ImageCPRMapper/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,6 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) {
773773
];
774774
if (useProjection) {
775775
tcoordFSDec.push(
776-
'uniform vec3 volumeSizeMC;',
777776
'uniform int projectionSlabNumberOfSamples;',
778777
'uniform float projectionConstantOffset;',
779778
'uniform float projectionStepLength;'
@@ -930,7 +929,7 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) {
930929

931930
// Loop on all the samples of the projection
932931
tcoordFSImpl.push(
933-
'vec3 projectionScaledDirection = projectionDirection / volumeSizeMC;',
932+
'vec3 projectionScaledDirection = (MCTCMatrix * vec4(projectionDirection, 0.0)).xyz;',
934933
'vec3 projectionStep = projectionStepLength * projectionScaledDirection;',
935934
'vec3 projectionStartPosition = volumePosTC + projectionConstantOffset * projectionScaledDirection;',
936935
'vec4 tvalue = initialProjectionTextureValue;',
@@ -1199,16 +1198,11 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) {
11991198
}
12001199
// Projection uniforms
12011200
if (model.renderable.isProjectionEnabled()) {
1202-
const image = model.currentImageDataInput;
1203-
const spacing = image.getSpacing();
1204-
const dimensions = image.getDimensions();
12051201
const projectionSlabThickness =
12061202
model.renderable.getProjectionSlabThickness();
12071203
const projectionSlabNumberOfSamples =
12081204
model.renderable.getProjectionSlabNumberOfSamples();
12091205

1210-
const volumeSize = vec3.mul([], spacing, dimensions);
1211-
program.setUniform3fArray('volumeSizeMC', volumeSize);
12121206
program.setUniformi(
12131207
'projectionSlabNumberOfSamples',
12141208
projectionSlabNumberOfSamples

0 commit comments

Comments
 (0)