@kitware/vtk.js 29.11.0 → 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.
|
@@ -52,7 +52,8 @@ function vtkStringArray(publicAPI, model) {
|
|
|
52
52
|
/* eslint-disable no-use-before-define */
|
|
53
53
|
publicAPI.newClone = () => newInstance({
|
|
54
54
|
name: model.name,
|
|
55
|
-
numberOfComponents: model.numberOfComponents
|
|
55
|
+
numberOfComponents: model.numberOfComponents,
|
|
56
|
+
empty: true
|
|
56
57
|
});
|
|
57
58
|
/* eslint-enable no-use-before-define */
|
|
58
59
|
|
|
@@ -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
|
|
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 /
|
|
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
|
-
|
|
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);
|