Hello,<br><br>I&#39;m using vtkImageViewer2 and I want to apply a geometric mask to its input data ( vtkImageData ). The mask could be a rectangle, a circle, a polygon or a combination of any of the three shapes. The mask will be applied to all the images on the vtkImageData stack. 
<br><br>Searching over the mailing list and the online documentation I found vtkPolyDataToImageStencil can be the key class to get what I need but I&#39;m not familiar with the vtk*Stencil* classes and I need some help.<br>
<br>Which is the correct pipeline to achieve what I need? I guess it could be the following, but I&#39;m not quite sure<br><br>First set the input for vtkPolyDataToImageStencil, ( a vtkPolyData object with the desired shape ). Then set the output port of vtkPolyDataToImageStencil to the input connection of vtkImageStencilData. Third, SetStencil and SetBackgroundInput to vtkImageStencil with the vtkImageStencilData and vtkImageData respectively. And finally set the input of vtkImageViewer2 with the output of the vtkImageStencil.
<br><br>Is that ok or there&#39;s an easier way to do it?<br><br>Another question I have is regarding the coordinate space. My mask shapes will be defined in pixel space, where I have to indicate this in the pipeline?<br>
The last question is, how I define the color of my mask?<br><br>Thanks in advance!<br>