# vtkImageActor interpolation limited to linear

**URL:** <https://discourse.vtk.org/t/vtkimageactor-interpolation-limited-to-linear/4858>\
**Category:** Development\
**Created:** [December 18, 2020, 7:27pm UTC](https://discourse.vtk.org/t/vtkimageactor-interpolation-limited-to-linear/4858 "2020-12-18T19:27:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)\
**Post date:** [December 18, 2020, 8:54pm UTC](https://discourse.vtk.org/t/vtkimageactor-interpolation-limited-to-linear/4858/4 "2020-12-18T20:54:58Z")

</div>

Thanks for the additional information. I can confirm that using the default linear interpolation you get a highly zoomed image in Slicer like this:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/d11dc15299977bf30ed3a9fb7ea7ef72a2581ed6.jpeg)

After switching to cubic interpolation you get this - no more diamond-shaped interpolation artifacts:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/7/7c5ebba555018624b56260130872b3fce9b65c72.jpeg)

You can temporarily switch to cubic interpolation in 3D Slicer by typing this into the Python console:

```python
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
reslice = slicer.app.applicationLogic().GetSliceLogic(sliceNode).GetBackgroundLayer().GetReslice()
reslice.SetInterpolationModeToCubic()
slicer.util.forceRenderAllViews()

```

I think we just use simple linear interpolation in Slicer because this has not been reported as a problem over the last 20 years and thousands of medical image computing projects. We can easily make cubic interpolation option available from the GUI or maybe switch to cubic interpolation automatically when a certain zoom factor is reached.

> [@spencermanwell](#):
>
> Is this issue a problem for other users? Are there any intentions for VTK developers to extend the OpenGL texture maps to include cubic (or higher order) interpolation?

In 3D Slicer, we perform our image reslicing and layer blending pipeline on CPU. This has many advantages: no need to transfer the volume to GPU memory (there is no risk that we cannot visualize a volume because it does not fit into GPU memory), we can display non-linearly transformed volumes without warping the entire 3D volume (just by passing the transformation pipeline to the reslice filter), use standard VTK filters for blending and other processing, etc.

Of course running this pipeline on the GPU it is considerably slower than the GPU, but since on a typical computer and typical images the speed is acceptable (about 50fps on an i7 laptop for a 512^3 volume), we are not in a rush to move everything to the GPU.

---

_[View the full topic](https://discourse.vtk.org/t/vtkimageactor-interpolation-limited-to-linear/4858)._
