# Interpolation Between Slices

**URL:** <https://discourse.slicer.org/t/interpolation-between-slices/7330>\
**Category:** Support\
**Created:** [June 27, 2019, 3:28am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330 "2019-06-27T03:28:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juicy](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Juicy](https://discourse.slicer.org/u/Juicy)\
**Post date:** [June 27, 2019, 3:28am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/1 "2019-06-27T03:28:23Z")

</div>

Hi,

I have a CT scan of a head which was acquired with 4mm slices. I am trying to reduce some of the step artefacts in the segment. There seems to not be a very smooth interpolation between the axial slices. If you look in the coronal and saggital slices you can see fairly distinct steps in the volume.

I have tried re-sampling the volume to have isotropic voxels with both the Crop Volume module and the Resample Scalar Volume module. I have tried various interpolation methods: linear, bspline, etc the bspline is slightly better than linear but none improve it particularly. I have tried upping the voxel size all around to 1mm square, this does improve the steps but also looses a considerable amount detail in the segment.

Are there any suggestions to improve the interpolation and reduce these step artefacts in the volume? Usually using making Isotropic voxels works quite well at getting rid of these but this doesn’t seem to work so well on this scan as the steps seem to be in the  
actual volume no matter what the voxel size. Perhaps there is some kind of filter which can reduce the steppyness of the volume?

Thanks for reading,

 ![Slicer%20Question](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/7/c7dc43b9cc84b586d4ec906654d3073bafac338a.jpeg)

Operating system: Windows 7  
Slicer version: 4.10.1  
Expected behavior:  
Actual behavior:

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 27, 2019, 3:54am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/2 "2019-06-27T03:54:33Z")

</div>

Extremely sparse volumes, such as yours, are not well suited for 3D reconstruction or analysis. [You cannot utilize high in-plane resolution if your slices are so far apart](https://discourse.slicer.org/t/fetal-lung-volume-calculation/578/5), as there is no information about how to fill the huge 4mm gaps between the slices.

To make the volume less sparse, you can crop volume with “Isotropic spacing” enabled (and increase “Spacing scale” if the volume is getting too big). You may try to further reduce staircase artifact by using [Smoothing effect](https://discourse.slicer.org/t/fetal-lung-volume-calculation/578/7).

---

<div class="post-metadata">

**Author:** ![Juicy](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Juicy](https://discourse.slicer.org/u/Juicy)\
**Post date:** [June 27, 2019, 4:19am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/3 "2019-06-27T04:19:46Z")

</div>

Thanks for the reply.

I suppose the best option would be to have a scan protocol which limits the slice spacing to 1mm-2mm or there abouts. However I don’t think this scan was taken with bio-models in mind so I was trying to see what I could do with the data as is.

I may try and see if the volume data is still on the CT scanner. If so they may be able to reslice the data to 1mm slices.

The difficulty I have found with the smoothing effects is that while they get rid of some of the steps they tend to loose a lot of fine detail etc.

Thanks again.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 27, 2019, 4:28am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/4 "2019-06-27T04:28:42Z")

</div>

> [@Juicy](#):
>
> The difficulty I have found with the smoothing effects is that while they get rid of some of the steps they tend to loose a lot of fine detail etc.

This is exactly the inherent problem with sparse data. You cannot utilize the fine details in the image slice directly, if those details are completely missing in large areas between two slices.

---

<div class="post-metadata">

**Author:** ![Lorensen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lorensen/32/31_2.png) [@Lorensen](https://discourse.slicer.org/u/Lorensen)\
**Post date:** [June 27, 2019, 4:49am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/5 "2019-06-27T04:49:22Z")

</div>

I started to implement this [Insight Journal Article](https://www.insight-journal.org/browse/publication/881) as an ITK remote module. My github repo is [here](https://github.com/lorensen/ShapeBasedInterpolation).

I could attempt to revive it.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 27, 2019, 5:12am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/6 "2019-06-27T05:12:38Z")

</div>

Would this algorithm work for grayscale images?

For labelmap interpolation we have already integrated [this](http://insight-journal.org/browse/publication/977) ITK algorithm. I’m not sure it the method described in the Boydev2012 paper would be significantly better.

---

<div class="post-metadata">

**Author:** ![Lorensen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lorensen/32/31_2.png) [@Lorensen](https://discourse.slicer.org/u/Lorensen)\
**Post date:** [June 27, 2019, 1:37pm UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/7 "2019-06-27T13:37:21Z")

</div>

Boydev is for grey scale images.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 28, 2019, 10:45pm UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/8 "2019-06-28T22:45:54Z")

</div>

Great. It would be interesting to see how the Boydev method results compare to a simple bspline or sinc image interpolation.

---

<div class="post-metadata">

**Author:** ![kayarre](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kayarre/32/3606_2.png) [@kayarre](https://discourse.slicer.org/u/kayarre)\
**Post date:** [February 6, 2020, 4:03am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/9 "2020-02-06T04:03:33Z")

</div>

Is there a way to create a sparse volume that has gaps?

I am thinking of using an alpha channel that essentially blanks out slices that are absent?

The use case here is histology slices that have a known thickness ( say 5 microns) and then a 25 micron gap until the next slice?  
The problem I see is that the image volume size will explode and be difficult to test on.

Any thoughts on how slicer could be used here or where ITK/VTK would make it easier?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 6, 2020, 4:17am UTC](https://discourse.slicer.org/t/interpolation-between-slices/7330/10 "2020-02-06T04:17:28Z")

</div>

This should be no problem at all. You can create a “mask” segment that only contains the editable regions and then select that segment in Segment Editor / Masking / Editable area. -\> Inside Mask segment. To not clutter the viewers, you can hide the mask segment or make it almost completely transparent.
