Prevent Renderer from Smoothing Image - Prefer to See Pixelated

Hello,

I am displaying images in a vtkRenderWindow using vtkImageSlice (with a vtkImageResliceToColors mapper), a vtkImageStack, and a vtkRenderer.
When the images render, they appear “smoothed”. If I zoom in on an individual pixel, it may display a gradient of colors. I want to be able to distinguish each individual pixel, and I want each individual pixel to map to only one color. What setting or settings do I need to use?

Thank you,
Michelle Kline

You should be able to change interpolation type to nearest neighbor.

Thanks, Andras, but where is the interpolation type property? Is it a property of vtkRenderer? vtkRenderWindow? Other?

  • Michelle

OH! I should have mentioned that I am initially passing the image through vtkImageReslice! Maybe that is why? But if it is vtkImageReslice that is doing the smoothing, then why does an image obtained by vktImageReslice.GetOutput() have smoothing, even if I have set the resliceAxes to be the identity matrix?

Check all the classes that you use if they have interpolation options. You should be familiar with your pipeline and know what each component does anyway.

Hi Michelle, if you have a vtkImageSlice object you can turn off the smoothing like so:

imageSlice.GetProperty().SetInterpolationTypeToNearest()

Thanks, David. That did the trick.