# vtkProbeFilter or vtkImageReslice question

**URL:** https://discourse.vtk.org/t/vtkprobefilter-or-vtkimagereslice-question/7270
**Category:** Support
**Created:** [November 24, 2021, 4:04pm UTC](https://discourse.vtk.org/t/vtkprobefilter-or-vtkimagereslice-question/7270 "2021-11-24T16:04:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![GloriaArienti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gloriaarienti/32/4335_2.png) [@GloriaArienti](https://discourse.vtk.org/u/GloriaArienti)
#### Post date: [November 24, 2021, 4:04pm UTC](https://discourse.vtk.org/t/vtkprobefilter-or-vtkimagereslice-question/7270/1 "2021-11-24T16:04:33Z")

</div>

Hello, we are trying to extract an oblique cross-section across a 3D image, i.e. a 2D image extracted from the colored volume in image below, oriented as the plane (a `vtkPlane`) highlighted in white.

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

We have tried in several ways with `vtkCutter`, `vtkProbeFilter` or `vtkImageReslice`.

`vtkCutter` works, but yield a `vtkPolyData` with non-regular spacing, and for some reason we’d like to get an image with regular spacing.

We have also triedto use a 2D image as the input object for `vtkProbeFilter` or `vtkImageReslice` (with the `SetInformationInput` option), but we are not able to extract any values, and the resulting image is generally filled with zeros…

 ![image](https://discourse.vtk.org/uploads/default/original/2X/c/ce756aa75163511da5d24aacf7b93e7be20d6e6f.png)

… or with some strange values just at some points.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/7/777aee783a55652dda6506fbcccc3fad5fb31be5.png)

Could you point us to some relevant and working example?

Alternatively to using `vtkProbeFilter` or `vtkImageReslice`, we could also consider resampling the `vtkPolyData` obtained from `vtkCutter` in order to obtain an image with regular spacing, but we need advice also for this.

Thanks!

---

<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: [November 26, 2021, 2:56am UTC](https://discourse.vtk.org/t/vtkprobefilter-or-vtkimagereslice-question/7270/2 "2021-11-26T02:56:35Z")

</div>

vtkImageReslice is the best choice - best speed and quality, and you can specify any output spacing you want. The API of this filter is somewhat different from most other VTK filters, in that it is somewhat redundant - there are several ways to achieve the same outcome - and not all settings are compatible.

I would recommend to check out vtkImageReslice examples in VTK examples or in applications such as ParaView or 3D Slicer. If you don’t find any then start from a VTK example, modify it as you think will work, and if it does not work as you expect then run it in a debugger, step by step, to see how exactly the output origin, spacing, axis directions, and extents are computed and why things go wrong.
