Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.24k stars 380 forks source link

Volume Masking #2017

Open MAdelElbayumi opened 3 years ago

MAdelElbayumi commented 3 years ago

Need

I have a volume and a labelmap and using paintfilter, I got this labelmap drawn on the volume with red, I want to use the labelmap as a binary mask for the volume

Feature

Here is the current behavior: image I want to only show the cells of the volume at the labels indices without the need of changing the data (binary multiplication of volume with labelmap)

finetjul commented 3 years ago

Volume rendering with masking is not supported in VTK.JS. We do not plan to add such feature at short term.

Feel free to add it yourself, or reach us out (via private message or on our website) if you want our professional support.

thewtex commented 1 year ago

Related, I added the ability to use label images to modulate (the settings could be adjusted to behave like a mask) on a volume for itkWidgets.

Here is a demo of different possibilities of the behavior, whether the label is "colored" (has hue) or not.

Untitled_ Feb 15, 2023 12_59 PM.webm

Reproduce with:

https://kitware.github.io/itk-vtk-viewer/app/?image=https://data.kitware.com/api/v1/file/5ecc803b9014a6d84e8ac8e2/download/cells.nrrd&labelImage=https://data.kitware.com/api/v1/file/5ecc803c9014a6d84e8ac8ea/download/cells_labels.nrrd

Set the OpacityMode on the VolumeProperty to PROPORTIONAL.

@aylward

aylward commented 1 year ago

@thewtex - very cool! Are the underlying methods specific to itkWidgets or have you extended the vtk.js rendering pipeline to support a labelmap that modulates the rendering of an image?