# vtkSplineFilter: Generating mask image.

**URL:** https://discourse.vtk.org/t/vtksplinefilter-generating-mask-image/4296
**Category:** Development
**Created:** [September 25, 2020, 5:32am UTC](https://discourse.vtk.org/t/vtksplinefilter-generating-mask-image/4296 "2020-09-25T05:32:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Vinod\_Pillai](https://discourse.vtk.org/user_avatar/discourse.vtk.org/vinod_pillai/32/2380_2.png) [@Vinod\_Pillai](https://discourse.vtk.org/u/Vinod_Pillai)
#### Post date: [September 25, 2020, 5:32am UTC](https://discourse.vtk.org/t/vtksplinefilter-generating-mask-image/4296/1 "2020-09-25T05:32:48Z")

</div>

I have some control points . I am using vtkSplineFilter to uniformly subdivide and generate a closed polyline from these control points. I would like to generate a mask image using the spline filter output, where the region inside the closed contour is filled with white. Please suggest a technique.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 25, 2020, 1:58pm UTC](https://discourse.vtk.org/t/vtksplinefilter-generating-mask-image/4296/2 "2020-09-25T13:58:20Z")

</div>

You can use `vtkPolyDataToImageStencil` for this.

However, manual image segmentation has been implemented so many times that I would not recommend spend your time with it. You can instead use/customize/extend segment editors of any of the free, open-source medical image computing applications, such as 3D Slicer or MITK.
