@@ -203,7 +203,7 @@ import BoundingRectangle from '@/src/components/tools/BoundingRectangle.vue';
203203import { useToolSelectionStore } from ' @/src/store/tools/toolSelection' ;
204204import { useAnnotationToolStore } from ' @/src/store/tools' ;
205205import { doesToolFrameMatchViewAxis } from ' @/src/composables/annotationTool' ;
206- import { TypedArray } from ' @kitware/vtk.js/types' ;
206+ import type { TypedArray } from ' @kitware/vtk.js/types' ;
207207import { useResizeObserver } from ' ../composables/useResizeObserver' ;
208208import { useOrientationLabels } from ' ../composables/useOrientationLabels' ;
209209import { getLPSAxisFromDir } from ' ../utils/lps' ;
@@ -241,7 +241,6 @@ import {
241241 WL_HIST_BINS ,
242242} from ' ../constants' ;
243243import { useProxyManager } from ' ../composables/proxyManager' ;
244- import { getShiftedOpacityFromPreset } from ' ../utils/vtk-helpers' ;
245244import { useLayersStore } from ' ../store/datasets-layers' ;
246245import { useViewCameraStore } from ' ../store/view-configs/camera' ;
247246import useLayerColoringStore from ' ../store/view-configs/layers' ;
@@ -805,34 +804,14 @@ export default defineComponent({
805804 lut .setDataRange (... ctFunc .mappingRange );
806805
807806 const pwf = proxyManager .getPiecewiseFunction (arrayName );
808- pwf .setMode (opFunc . mode );
807+ pwf .setMode (vtkPiecewiseFunctionProxy . Mode . Points );
809808 pwf .setDataRange (... opFunc .mappingRange );
810-
811- switch (opFunc .mode ) {
812- case vtkPiecewiseFunctionProxy .Mode .Gaussians :
813- pwf .setGaussians (opFunc .gaussians );
814- break ;
815- case vtkPiecewiseFunctionProxy .Mode .Points : {
816- const opacityPoints = getShiftedOpacityFromPreset (
817- opFunc .preset ,
818- opFunc .mappingRange ,
819- opFunc .shift
820- );
821- if (opacityPoints ) {
822- pwf .setPoints (opacityPoints );
823- }
824- break ;
825- }
826- case vtkPiecewiseFunctionProxy .Mode .Nodes :
827- pwf .setNodes (opFunc .nodes );
828- break ;
829- default :
830- }
809+ pwf .setPoints ([[0 , 1 ]]); // only slice mesh controls opacity
810+ rep .setOpacity (blendConfig .opacity );
831811
832812 // control color range manually
833813 rep .setRescaleOnColorBy (false );
834814 rep .setColorBy (arrayName , location );
835- rep .setOpacity (blendConfig .opacity );
836815
837816 // Need to trigger a render for when we are restoring from a state file
838817 viewProxy .value .renderLater ();
0 commit comments