Downsampling 3D image data in VTK without aliasing?

Hi, I would like downsample some 3D image data by a factor of 2 without introducing aliasing artifact as described here:

I am able to do the downsampling with vtkImageReslice.SetOutputSpacing. However, it doesn’t appear to apply an anti-aliasing filter before the downsampling. Is that correct? If so, is there an alternative method I can use that does apply an anti-aliasing filter?
thank you in advance,

The easiest way to do antialiased resizing is with vtkImageResize. This filter will perform band-limited sinc interpolation. You can use it to adjust the spacing as follows (using Python as an example):

resize = vtkImageResize()
resize.SetOutputSpacing(sx, sy, sz)

Alternatively, you can use an antialiased interpolator with vtkImageReslice, though this isn’t quite as efficient:

interpolator = vtkImageSincInterpolator()

reslice = vtkImageReslice()
reslice.SetOutputSpacing(sx, sy, sz)

The idea here is that a windowed and stretched sinc kernel is used to perform the resizing with antialiasing.


Thanks, yet again @dgobbi! I will try using vtkImageResize and will let you know how it goes. :slight_smile:

vtkImageResize worked great! Chalk up another win for @dgobbi.