# Handling Missing Slice Data in RT Structures: How Does SlicerRT Interpolate Missing RT Data?

**URL:** <https://discourse.slicer.org/t/handling-missing-slice-data-in-rt-structures-how-does-slicerrt-interpolate-missing-rt-data/40431>\
**Category:** Support\
**Tags:** slicerrt\
**Created:** [November 28, 2024, 4:57pm UTC](https://discourse.slicer.org/t/handling-missing-slice-data-in-rt-structures-how-does-slicerrt-interpolate-missing-rt-data/40431 "2024-11-28T16:57:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamerWagih](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tamerWagih](https://discourse.slicer.org/u/tamerWagih)\
**Post date:** [November 28, 2024, 4:57pm UTC](https://discourse.slicer.org/t/handling-missing-slice-data-in-rt-structures-how-does-slicerrt-interpolate-missing-rt-data/40431/1 "2024-11-28T16:57:00Z")

</div>

Hello Slicer Community,

I’m currently working with **RT structure sets (RTSS)**, and I’ve encountered an interesting issue when using **Plastimatch** ’s `convert` command to extract RT structures as label images. The issue is that **Plastimatch** outputs label images where certain slices are missing, particularly when there’s an **unequal slice spacing**. Here’s the warning I received from **Plastimatch** :

```auto
Warning: Slice spacing of RTSS may be unequal
-2.012 - -17.012 = 15 vs. 2.5

```

This suggests that there’s a **15mm gap** between certain slices, where **Plastimatch** reports the usual **2.5mm spacing** between slices. **Matlab** confirmed this, as shown below:

```auto
Z-coordinates and slice spacing (in mm):
From -37.012 mm to -34.512 mm: Spacing = 2.500 mm
From -34.512 mm to -32.012 mm: Spacing = 2.500 mm
From -32.012 mm to -29.512 mm: Spacing = 2.500 mm
...
From -17.012 mm to -2.012 mm: Spacing = 15.000 mm

```

This gap (15mm) between `-17.012 mm` and `-2.012 mm` results in missing RT structure data for some slices. However, when I load the **same RT structure set in Slicer** using **SlicerRT** , the visualization displays **the full RT structure data** with **no missing slices or gaps** , which is quite puzzling.

### My Questions:

1. **How does SlicerRT handle this missing slice data or unequal slice spacing when visualizing RT structure sets?**

- Does **SlicerRT** apply any interpolation to the RT structure data in order to fill the gaps caused by unequal slice spacing?
- If so, what part of the **SlicerRT code** is responsible for this interpolation or handling of unequal slice spacing? Is there a specific function or algorithm that addresses this issue?

1. **Is there a specific process in Slicer that allows it to visualize the missing slices properly, even when Plastimatch reports unequal spacing?**
2. **Could you point me to any documentation or relevant code sections in SlicerRT that explain how the system handles or interpolates RT structure sets with unequal slice spacing or missing slices?**

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 29, 2024, 9:29am UTC](https://discourse.slicer.org/t/handling-missing-slice-data-in-rt-structures-how-does-slicerrt-interpolate-missing-rt-data/40431/2 "2024-11-29T09:29:01Z")

</div>

RTSS contains a series of 2D contours. These contours are triangulated to a closed surface, and then that surface is converted into a labelmap. Here is the paper about the actual triangulation:

> **[Reconstruction of surfaces from planar contours through contour interpolation](https://www.spiedigitallibrary.org/conference-proceedings-of-spie/9415/94151R/Reconstruction-of-surfaces-from-planar-contours-through-contour-interpolation/10.1117/12.2081436.short)**
>
> Segmented structures such as targets or organs at risk are typically stored as 2D contours contained on evenly spaced cross sectional images (slices). Contour interpolation algorithms are implemented in radiation oncology treatment planning software...

If contours are missing, it simply means that the adjacent contours to triangulate will be farther from each other there than in the rest of the structure.

About the rest of the conversions and the conversion mechanism itself please see these links  
[https://slicer.readthedocs.io/en/latest/user\_guide/image\_segmentation.html](https://slicer.readthedocs.io/en/latest/user_guide/image_segmentation.html)

> **[Pinter2019\_Manuscript.pdf](https://labs.cs.queensu.ca/perklab/wp-content/uploads/sites/3/2024/02/Pinter2019_Manuscript.pdf)**
>
> 707.26 KB

> **[Dynamic Representation of Anatomical Structures in Radiation Therapy...](https://qspace.library.queensu.ca/handle/1974/26422)**
>
> Segmentation is a ubiquitous operation in radiation therapy (RT) and in medical image computing (MIC) in general. Various data representations can describe segmentation results, such as binary volumes or surface models. Conversions between them are...

---

<div class="post-metadata">

**Author:** ![tamerWagih](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tamerWagih](https://discourse.slicer.org/u/tamerWagih)\
**Post date:** [November 29, 2024, 12:38pm UTC](https://discourse.slicer.org/t/handling-missing-slice-data-in-rt-structures-how-does-slicerrt-interpolate-missing-rt-data/40431/3 "2024-11-29T12:38:24Z")

</div>

Thank you so much for the detailed explanation and the helpful links! I’ll take a look at the resources you’ve shared and dive deeper into the code. Appreciate your help,
