# How to apply mask to a transformed vtkVolume

**URL:** https://discourse.vtk.org/t/how-to-apply-mask-to-a-transformed-vtkvolume/4791
**Category:** Support
**Created:** [December 8, 2020, 11:19am UTC](https://discourse.vtk.org/t/how-to-apply-mask-to-a-transformed-vtkvolume/4791 "2020-12-08T11:19:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yuhuimoon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/c6cbf5/32.png) [@yuhuimoon](https://discourse.vtk.org/u/yuhuimoon)
#### Post date: [December 8, 2020, 11:19am UTC](https://discourse.vtk.org/t/how-to-apply-mask-to-a-transformed-vtkvolume/4791/1 "2020-12-08T11:19:28Z")

</div>

I can apply a binary mask to a **vtkVolume** by using **SetMaskInput()**(in vtkGPUVolumeRayCastMapper class).

```
volumeMapper->SetMaskTypeToBinary();
volumeMapper->SetMaskInput(imageMask);

```

The vtkVolume has the mask effects(hole) as I aspect. The vtkVolume has not been transformed. If the vtkVolume is transformed (I use **setUserMatrix()** ), the mask has no effect. I try to use **vtkImageReslice** to apply a matrix to a vtkImageData, and then use the image data for SetMaskInput(). But I failed. Is there any way to solve the problem? Thanks in advance.
