# vtkImageStencil and vtkPolyDataToImageStencil

**URL:** https://discourse.paraview.org/t/vtkimagestencil-and-vtkpolydatatoimagestencil/13371
**Category:** ParaView Support
**Tags:** python
**Created:** [November 29, 2023, 9:50am UTC](https://discourse.paraview.org/t/vtkimagestencil-and-vtkpolydatatoimagestencil/13371 "2023-11-29T09:50:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jvoor](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/71c47a/32.png) [@jvoor](https://discourse.paraview.org/u/jvoor)
#### Post date: [November 29, 2023, 9:50am UTC](https://discourse.paraview.org/t/vtkimagestencil-and-vtkpolydatatoimagestencil/13371/1 "2023-11-29T09:50:42Z")

</div>

Hi,

I am trying to create a volumetric mask (vtkImageData) from a 3D contour (vtkPolyData) using a Programmable Filter in paraview. I found this example to work from [online](https://examples.vtk.org/site/Python/PolyData/PolyDataToImageDataStencil/) but paraview cannot find vtkImageStencil or vtkPolyDataToImageStencil. I have tried importing them from vtkmodules and also vtkmodules.vtkImagingStencil

What am I missing? Also, maybe I am going about this process the wrong way. Using a contour to clip a regular grid is a fairly standard process, is there not an easy way to do this in paraview already?

Thanks
