# Convert and export .stl file to .dcm

**URL:** https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093
**Category:** Support
**Tags:** dicom
**Created:** [August 19, 2020, 10:17pm UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093 "2020-08-19T22:17:35Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 19, 2020, 10:17pm UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/1 "2020-08-19T22:17:35Z")

</div>

Hi everyone,

I would like to ask you to how to export the dicom file from .stl.  
I loaded .stl file (surface structure) and it had just outlier of the object.  
Is It possible to export as a dicom format?

Thanks,

---

<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: [August 19, 2020, 10:23pm UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/2 "2020-08-19T22:23:05Z")

</div>

What DICOM information object would you like to create from the segmentation: segmentation object, fake CT image, RT structure set,…?

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 2:29am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/3 "2020-08-20T02:29:07Z")

</div>

Hi Andras,  
I want to create a fake CT image set using that .stl file. Actually, the stl file contains 3D surface object. So, I think each CT slices should have just contour of the 3d structure.  
Thanks in advance for any help you can give!

---

<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: [August 20, 2020, 2:48am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/4 "2020-08-20T02:48:39Z")

</div>

What the fake CT is going to be used for radiation therapy planning? Deep learning training? Do you need to generate realistic intensities, texture, etc.?

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 2:52am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/5 "2020-08-20T02:52:02Z")

</div>

I am going to use the fake CT for radiation therapy planning if possible. I just need CT image set that is contained the 3D structure. would it be possible?

---

<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: [August 20, 2020, 3:03am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/6 "2020-08-20T03:03:26Z")

</div>

Do you want to paint in the structure (such as a device) into an existing CT image?

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 3:10am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/7 "2020-08-20T03:10:05Z")

</div>

No, my stl file has a 3D surface structure just like empty can. Once the ct set is exported, I can probably create structures and assign CT numbers via treatment planning system.

---

<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: [August 20, 2020, 3:15am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/8 "2020-08-20T03:15:25Z")

</div>

If you just the need the fake CT so that you can contour in the TPS then you can simplify the steps and just export the STL directly as an RT structure set. Install latest Slicer Preview Release, install SlicerRT extension to get the option of DICOM-RT export, load the STL file as segmentation (select “Segmentation” in Description column in Add data dialog), load the associated CT image (you cannot create valid RT structure set without referring to a CT), then use DICOM module to export the segmentation and CT.

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 3:19am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/9 "2020-08-20T03:19:58Z")

</div>

Thanks a lot, I will try it and reply back. By the way, what does the associated CT mean?

---

<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: [August 20, 2020, 3:20am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/10 "2020-08-20T03:20:27Z")

</div>

The planning CT, that contains real patient anatomy that the TPS can work on.

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 3:24am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/11 "2020-08-20T03:24:55Z")

</div>

I see, but if there is no patient CT at all, is it impossible to generate CT?

---

<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: [August 20, 2020, 3:26am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/12 "2020-08-20T03:26:35Z")

</div>

If you don’t have a CT then you can just use any CT that is taken of the body part you are interested in. If you don’t find a suitable image in Sample Data module then you can download form TCIA or similar freely accessible image databases.

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 3:28am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/13 "2020-08-20T03:28:27Z")

</div>

Got it, thank you for your help!

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 20, 2020, 4:21pm UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/14 "2020-08-20T16:21:47Z")

</div>

I can export a file from 3D Slicer, but something are wrong. First, the type name of the file is not ‘DCM file’, it is ‘370 File’ (‘1.2.276.0.7230010.3.1.4.1525450623.10920.1597934964.370’). Second, the size of the file is 1920x1018 and count is 1. Actually, I opened the CT which has 512x512 and 127 slices.How can I adjust the size of the file that is to be exported? Third, I got some of error when I tried to open it in TPS as below.  
i) dicom module: image pixel: read error  
ii) dicom IOD: read error  
iii) reading the ‘secondary capture image storage’ failed.

What I did is as below.  
i) open my stl file  
ii) open real CT (127 slices)  
iii) align the 3d structure from stl file to CT image via ‘Transform’  
iv) create ‘NewSubject’ and ‘New child study’ and put CT, stl, and transform into created new study  
v) export to dicom

Actually, what I want to do is,  
if there are some missing regions in CT, I want to make a extended CT via adding the structure from stl file.

Please advice me if I have to consider.  
Thanks in advance!

---

<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: [August 20, 2020, 5:46pm UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/15 "2020-08-20T17:46:32Z")

</div>

> [@wjd582](#):
>
> First, the type name of the file is not ‘DCM file’, it is ‘370 File’

That’s all good. There is no such thing as “DICOM” file extension. “.dcm” file extension is commonly used, but it is just for users to recognize file format more easily.

> [@wjd582](#):
>
> Second, the size of the file is 1920x1018 and count is 1.

This looks like a scene bundle file, which contains the entire scene as a secondary capture image in a private field. This is not what you need.

Instead, choose “Export series” in the DICOM export dialog.

Also make sure you use latest Slicer Preview Release, it has many DICOM improvements and fixes.

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 21, 2020, 1:39am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/16 "2020-08-21T01:39:00Z")

</div>

Finally, I exported the dcm file from 3D Slicer and imported it to TPS. But, in TPS, only information added to the original planning CT area can be imported and other information is disappearing.

However, my goal is to create an extended CT by adding 3D scan file (stl file).  
For example, the planning CT has only chest region images, but I need to have a head region information as well. In this case, can I add the head region (just surface structure(.stl file)) and export entire information as the Dicom format (extended CT) through 3D Slicer?

Thanks,

---

<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: [August 23, 2020, 1:59am UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/17 "2020-08-23T01:59:05Z")

</div>

You can expand an image using Crop volume module (if the chosen ROI is larger than the input image). You may need to use interpolated mode.

---

<div class="post-metadata">

### Author: ![wjd582](https://avatars.discourse-cdn.com/v4/letter/w/e36b37/32.png) [@wjd582](https://discourse.slicer.org/u/wjd582)
#### Post date: [August 24, 2020, 1:27pm UTC](https://discourse.slicer.org/t/convert-and-export-stl-file-to-dcm/13093/18 "2020-08-24T13:27:50Z")

</div>

I will try it. Many thanks!
