# Slice, resample and export along an oblique plane

**URL:** https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967
**Category:** Support
**Created:** [January 28, 2026, 9:15am UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967 "2026-01-28T09:15:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![N-Van](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@N-Van](https://discourse.slicer.org/u/N-Van)
#### Post date: [January 28, 2026, 9:15am UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967/1 "2026-01-28T09:15:14Z")

</div>

Hi,

new here. I’m processing CT scan data and I need to extract a resampled, arbitrarily oriented, cross section of my volume. I need a slice that doesn’t show artifacts/stripes, and I need it with the same resolution as the volume (i.e. not a screen shot). For those familiar with Fiji, I need the exact same thing as “Reslice”, but with a plane that can be oriented in any direction.

I found and adapted this [code](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository/volumes.html#extract-slice-from-volume)

It requires the preliminary creation of a markup plane, which is used for creating a new volume with unitary thickness. This volume can then be exported as a 2D image with correct dimensions.

What I do is rotate a plane (Slice intersection/Interaction), focusing on the yellow view, until I find the orientation I need. Then I create a markup plane directly on the yellow view and run my script. That works very well.

The only problem is that the markup plane is always way too large when I create it:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/a/6a15a63bc3dbf61b9e0ac0393b8d6ffb45463bf2.jpeg)

I know I can manually reduce its width and height, but I’m looking for an automatic way to do that. More precisely, I’m looking for a way to adjust the markup plane to the valid data displayed in the yellow view:

 ![Screenshot_2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/7/f775b0186a72594bbe34c8c55f535f588e6bccd9.jpeg)

The validity of the displayed data can be accessed with the data probe (it displays “out of frame” for the surrounding pixels), so maybe I’m looking for a way to get all the valid pixels in the selected view and then their bounding box.

Any idea, anyone ?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [January 28, 2026, 9:53am UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967/2 "2026-01-28T09:53:28Z")

</div>

You can use the Transforms to move the volume instead of just using the view. Then you can resample the volume through the transform so that the pixels are in the plane of interest and you can then access the data as a slice, e.g. as a numpy array.

---

<div class="post-metadata">

### Author: ![N-Van](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@N-Van](https://discourse.slicer.org/u/N-Van)
#### Post date: [January 28, 2026, 10:28am UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967/3 "2026-01-28T10:28:09Z")

</div>

Thank you for your answer. This is probably what I’m going to do if don’t find any other solution.

I started by rotating the planes because I find it more convenient than rotating the whole volume, especially when there are multiple views to extract.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [January 28, 2026, 3:57pm UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967/4 "2026-01-28T15:57:11Z")

</div>

You may want to look into the “Reorient Volume” option in the CropVolume. Tutorial here to show an example of how to bring a randomly oriented volume to canonical orientation and then resample in that orientation, but the idea still applies:

> <https://github.com/SlicerMorph/Tutorials/blob/main/Slicer_Modules/Crop_Volume/Readme.MD#using-cropvolume-to-simulatenously-reorient-and-resample-your-data>

---

<div class="post-metadata">

### Author: ![N-Van](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@N-Van](https://discourse.slicer.org/u/N-Van)
#### Post date: [January 28, 2026, 5:36pm UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967/5 "2026-01-28T17:36:14Z")

</div>

> [@pieper](#):
>
> you can then access the data as a slice, e.g. as a numpy array.

Actually that gives me an idea: convert the resampled slice to an np array and get the bounding box of non zero values.

---

<div class="post-metadata">

### Author: ![N-Van](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@N-Van](https://discourse.slicer.org/u/N-Van)
#### Post date: [January 28, 2026, 5:43pm UTC](https://discourse.slicer.org/t/slice-resample-and-export-along-an-oblique-plane/45967/6 "2026-01-28T17:43:44Z")

</div>

Thank you for hinting me at this module. In my case I don’t have any prefered orientation for the whole scan (several specimens may have been scanned together), and I will have to select multiple planes in each volume. Reorienting the whole volume is not the most convenient approach, that’s why I started with cross section planes.
