Skip to content

Commit dcd987b

Browse files
committed
fix(volume-rendering): keep Shift and Width on the refit range of a streamed image
The sliders sampled their full range once, so after a streaming image finished loading they kept the partial range and Reset views restored it.
1 parent 2bad156 commit dcd987b

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎src/components/VolumeRendering.vue‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { useCurrentImage } from '@/src/composables/useCurrentImage';
2222
import useVolumeColoringStore from '@/src/store/view-configs/volume-coloring';
2323
import {
2424
getColorFunctionRangeFromPreset,
25-
getRelativePresetRange,
2625
getShiftedOpacityFromPreset,
2726
} from '@/src/utils/vtk-helpers';
2827
@@ -255,13 +254,13 @@ export default defineComponent({
255254
return [0, 1];
256255
});
257256
258-
const fullMappingRange = computed(() => {
259-
const image = currentImageData.value;
260-
return (
257+
// The store refits a relative preset's opacity range once a streaming image loads.
258+
const fullMappingRange = computed(
259+
() =>
261260
getColorFunctionRangeFromPreset(selectedPreset.value || '') ||
262-
(image ? getRelativePresetRange(image) : imageDataRange.value)
263-
);
264-
});
261+
opacityFunction.value?.mappingRange ||
262+
imageDataRange.value
263+
);
265264
const fullMappingRangeWidth = computed(() => {
266265
const range = fullMappingRange.value;
267266
return range[1] - range[0];

0 commit comments

Comments
 (0)