The vtkPolyDataToImageStencil expects one of two types of input:
The polydata can either be a closed surface mesh or a series of polyline contours (one contour per slice).
So you would only use SetPolys() if your polydata ROI is a closed surface. But for closed 2D contours, use SetLines().
Explanation: A polygon is not a polyline, these are two distinct kinds of VTK primitives. A polyline is what you need. So, what you need to do is build a vtkCellArray for the contour, and then use polyData.SetLines(polylines)
to create a polydata for vtkPolyDataToImageStencil.
Also, the Points must take the spacing, origin, etc. of the image data into account. In general, points in VTK represent positions in physical space, i.e. for medical images positions are usually measured in millimeters. So to make an ROI for slice 100, you must first compute what the position (in physical space) of slice 100 is. Then use that position when setting the points.