From a041c8c6e20732c2cb3243c6f0cb47e08c7616e2 Mon Sep 17 00:00:00 2001 From: Sankhesh Jhaveri Date: Wed, 20 Aug 2025 10:16:18 -0400 Subject: [PATCH] fix(rendering): Removes downsampling of the volume --- .../vtk/VtkBaseVolumeRepresentation.vue | 6 ----- src/utils/volumeProperties.ts | 22 ------------------- 2 files changed, 28 deletions(-) diff --git a/src/components/vtk/VtkBaseVolumeRepresentation.vue b/src/components/vtk/VtkBaseVolumeRepresentation.vue index 4bf12947f..74e25642a 100644 --- a/src/components/vtk/VtkBaseVolumeRepresentation.vue +++ b/src/components/vtk/VtkBaseVolumeRepresentation.vue @@ -167,12 +167,6 @@ watchEffect(() => { mapper, }); - if (isImageStreaming.value) { - // reduce the quality of the volume until the entire volume is loaded - const sampleDistance = mapper.getSampleDistance(); - mapper.setSampleDistance(sampleDistance * 15); - } - view.requestRender(); }); diff --git a/src/utils/volumeProperties.ts b/src/utils/volumeProperties.ts index 1b5d161c3..3b636b957 100644 --- a/src/utils/volumeProperties.ts +++ b/src/utils/volumeProperties.ts @@ -12,28 +12,6 @@ import vtkVolumeProperty from '@kitware/vtk.js/Rendering/Core/VolumeProperty'; import { Vector3 } from '@kitware/vtk.js/types'; import { vec3 } from 'gl-matrix'; -/** - * Sets the volume sampling distance. - * @param mapper - * @param distance A value betweeen 0 and 1. - * @param imageData - */ -export function setSamplingDistance( - mapper: vtkVolumeMapper, - distance: number, - imageData: vtkImageData -) { - const sampleDistance = - 0.7 * - Math.sqrt( - imageData - .getSpacing() - .map((v) => v * v) - .reduce((a, b) => a + b, 0) - ); - mapper.setSampleDistance(sampleDistance * 2 ** (distance * 3.0 - 1.5)); -} - /** * Sets the edge gradient. * @param property