converting closed surface to binary image

You can use the image stencil to modify the

See how to clip vtkImageData with the specified mask? - #2 by zhang-qiang-github