Thresholding VolumeViewer

Hi all,

I’ve seen the examples of vtk js where the volume renderer is used in combination with vtkPiecewiseFunction and the vtkPiecewiseGaussianWidget
I was wondering if there is a way to use this piecewise function to threshold the volume show between two grayscale values?
As to see only the voxels that would lie inbetween these two values.

Kind regards,

The vtkPiecewiseGaussianWidget is more for interactive colormap and opacity exploration. If you want to only show voxel values that lie in a range, you will need to construct a vtkPiecewiseFunction that is 1 in the range and 0 outside the range, then set that function as the volume mapper’s scalar opacity function via setScalarOpacity.