# Volume Masking

**URL:** https://discourse.vtk.org/t/volume-masking/6261
**Category:** Web
**Created:** [July 28, 2021, 5:48pm UTC](https://discourse.vtk.org/t/volume-masking/6261 "2021-07-28T17:48:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MAdelElbayumi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/madelelbayumi/32/3717_2.png) [@MAdelElbayumi](https://discourse.vtk.org/u/MAdelElbayumi)
#### Post date: [July 28, 2021, 5:48pm UTC](https://discourse.vtk.org/t/volume-masking/6261/1 "2021-07-28T17:48:35Z")

</div>

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.

![image](https://discourse.vtk.org/uploads/default/original/2X/8/8e1ac50e704d7865d9a6049b145dba3da6b10d42.png)

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)

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [July 28, 2021, 6:32pm UTC](https://discourse.vtk.org/t/volume-masking/6261/2 "2021-07-28T18:32:12Z")

</div>

Hi, this could readily be a vtk.js filter. AFAIK we do not have such a filter, but we can add one. The usage would look something like `volume -> thresholdFilter -> mapper/actor/renderer`.

If you are interested, you can contribute such a filter. We may have time to create one, but it won’t be priority right now. You can learn [how to develop vtk.js classes](https://kitware.github.io/vtk-js/docs/develop_class.html), and see an example of a similar filter in the [ImageCropFilter](https://github.com/Kitware/vtk-js/blob/master/Sources/Filters/General/ImageCropFilter/index.js).
