@kitware/vtk.js 29.11.1 → 29.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -487,7 +487,7 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) {
487
487
  // weighting shift and scale
488
488
  `uniform float pwfshift0;`, `uniform float pwfscale0;`];
489
489
  if (useProjection) {
490
- tcoordFSDec.push('uniform vec3 spacing;', 'uniform int projectionSlabNumberOfSamples;', 'uniform float projectionConstantOffset;', 'uniform float projectionStepLength;');
490
+ tcoordFSDec.push('uniform vec3 volumeSizeMC;', 'uniform int projectionSlabNumberOfSamples;', 'uniform float projectionConstantOffset;', 'uniform float projectionStepLength;');
491
491
  }
492
492
  if (isDirectionUniform) {
493
493
  tcoordFSDec.push('in vec3 samplingDirVSOutput;');
@@ -571,7 +571,7 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) {
571
571
  }
572
572
 
573
573
  // Loop on all the samples of the projection
574
- tcoordFSImpl.push('vec3 projectionScaledDirection = projectionDirection / spacing;', 'vec3 projectionStep = projectionStepLength * projectionScaledDirection;', 'vec3 projectionStartPosition = volumePosTC + projectionConstantOffset * projectionScaledDirection;', 'vec4 tvalue = initialProjectionTextureValue;', 'for (int projectionSampleIdx = 0; projectionSampleIdx < projectionSlabNumberOfSamples; ++projectionSampleIdx) {', ' vec3 projectionSamplePosition = projectionStartPosition + float(projectionSampleIdx) * projectionStep;', ' vec4 sampledTextureValue = texture(volumeTexture, projectionSamplePosition);');
574
+ tcoordFSImpl.push('vec3 projectionScaledDirection = projectionDirection / volumeSizeMC;', 'vec3 projectionStep = projectionStepLength * projectionScaledDirection;', 'vec3 projectionStartPosition = volumePosTC + projectionConstantOffset * projectionScaledDirection;', 'vec4 tvalue = initialProjectionTextureValue;', 'for (int projectionSampleIdx = 0; projectionSampleIdx < projectionSlabNumberOfSamples; ++projectionSampleIdx) {', ' vec3 projectionSamplePosition = projectionStartPosition + float(projectionSampleIdx) * projectionStep;', ' vec4 sampledTextureValue = texture(volumeTexture, projectionSamplePosition);');
575
575
  switch (projectionMode) {
576
576
  case ProjectionMode.MAX:
577
577
  tcoordFSImpl.push(' tvalue = max(tvalue, sampledTextureValue);');
@@ -706,9 +706,11 @@ function vtkOpenGLImageCPRMapper(publicAPI, model) {
706
706
  if (model.renderable.isProjectionEnabled()) {
707
707
  const image = model.currentImageDataInput;
708
708
  const spacing = image.getSpacing();
709
+ const dimensions = image.getDimensions();
709
710
  const projectionSlabThickness = model.renderable.getProjectionSlabThickness();
710
711
  const projectionSlabNumberOfSamples = model.renderable.getProjectionSlabNumberOfSamples();
711
- program.setUniform3fArray('spacing', spacing);
712
+ const volumeSize = vec3.mul([], spacing, dimensions);
713
+ program.setUniform3fArray('volumeSizeMC', volumeSize);
712
714
  program.setUniformi('projectionSlabNumberOfSamples', projectionSlabNumberOfSamples);
713
715
  const constantOffset = -0.5 * projectionSlabThickness;
714
716
  program.setUniformf('projectionConstantOffset', constantOffset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "29.11.1",
3
+ "version": "29.11.2",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",