# Interpolating contours from a RTSTRUCT file using batch processing

**URL:** https://discourse.slicer.org/t/interpolating-contours-from-a-rtstruct-file-using-batch-processing/7587
**Category:** Support
**Created:** [July 15, 2019, 1:10pm UTC](https://discourse.slicer.org/t/interpolating-contours-from-a-rtstruct-file-using-batch-processing/7587 "2019-07-15T13:10:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Shekhar](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Shekhar](https://discourse.slicer.org/u/Shekhar)
#### Post date: [July 15, 2019, 1:10pm UTC](https://discourse.slicer.org/t/interpolating-contours-from-a-rtstruct-file-using-batch-processing/7587/1 "2019-07-15T13:10:42Z")

</div>

Hello,

I have an RTSTRUCT file (.dcm) and its reference files (ultrasound images in dicom format). RTSTRUCT file contains contour data for ROI at some slice locations, I would like to interpolate the contour data to all the slices using batch processing in 3D slicer or Platimatch.

I have done this manually in 3D Slicer manually and saved them to label maps for each ROI, since 3D slicer interpolated the contour data automatically. I would like to know how to interpolate the contour to all slices and save them as label maps using batch processing.

Thank you in advance for your help.

Regards,  
Shekhar

---

<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: [July 15, 2019, 1:51pm UTC](https://discourse.slicer.org/t/interpolating-contours-from-a-rtstruct-file-using-batch-processing/7587/2 "2019-07-15T13:51:05Z")

</div>

Please try the BatchProcessing module that does just this:

> **[SlicerRt/SlicerRT](https://github.com/SlicerRt/SlicerRT/tree/master/BatchProcessing)**
>
> Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), struc...

---

<div class="post-metadata">

### Author: ![Shekhar](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Shekhar](https://discourse.slicer.org/u/Shekhar)
#### Post date: [July 15, 2019, 2:43pm UTC](https://discourse.slicer.org/t/interpolating-contours-from-a-rtstruct-file-using-batch-processing/7587/3 "2019-07-15T14:43:38Z")

</div>

Hello Csaba,

I have my RTSTRUCT file and reference files in the same folder, but when I run the script as you suggested it gives the following error. The output folder is empty.

Script Used:

Slicer.exe --no-main-window --python-script BatchStructureSetConversion.py --input-folder Dir/RTandImages --output-folder /Output

Error Message:  
No reference volume found for segmentation RTSTRUCT: RTSTRUCT

 ![error-python](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/6/2630f097a212091ca40ceb0e8db15ab8ff1a9c56.png)

Regards,  
Shekhar

---

<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: [July 15, 2019, 3:31pm UTC](https://discourse.slicer.org/t/interpolating-contours-from-a-rtstruct-file-using-batch-processing/7587/4 "2019-07-15T15:31:27Z")

</div>

The CT does not just need to be in the same folder, but needs to be referenced from the RT structure set via DICOM to be considered reference. The reason for this is that you can have multiple structure sets and CTs in the input folder and they are paired automatically using this method. Most TPSs where you can export RTSTRUCT from create this link. How do you get the RTSTRUCT file?
