# Convert 3D dose distribution to DICOM RT dose

**URL:** <https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930>\
**Category:** Support\
**Created:** [May 26, 2019, 2:06pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930 "2019-05-26T14:06:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 26, 2019, 2:06pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/1 "2019-05-26T14:06:30Z")

</div>

Operating system: windows 7 64bit  
Slicer version: 4.8.0  
Expected behavior: DICOM dose distribution  
Actual behavior:

Hello,  
I got 3D dose distribution from Monte Carlo simulation. I want to know if 3D slicer can convert the 3D dose distribution to DICOM RT dose file in order to compare the DVHs.  
Thanks in advance.

---

<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:** [May 27, 2019, 1:30pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/2 "2019-05-27T13:30:16Z")

</div>

> [@ToufikDZ](#):
>
> dose distribution from Monte Carlo simulation

What format is it in? What do you use for MC simulation?

---

<div class="post-metadata">

**Author:** ![Hamburgerfinger](https://avatars.discourse-cdn.com/v4/letter/h/eb9ed0/32.png) [@Hamburgerfinger](https://discourse.slicer.org/u/Hamburgerfinger)\
**Post date:** [May 27, 2019, 3:27pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/3 "2019-05-27T15:27:00Z")

</div>

You can generally do this with the Slicer RT extension, but you need to also output the geometry, I.e. “region” or “cell” or however your code calls it, as a voxel type labelmap. Then you can use the DVH functionality of Slicer RT.

Note: Uncheck “show dose volumes only” because even though your volume is a dose volume, it’s probably not RT dose volume so it won’t immediately show up. The results will be displayed as “intensity volume histogram” but it’s equivalent to DVH.

---

<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:** [May 27, 2019, 3:29pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/4 "2019-05-27T15:29:56Z")

</div>

> [@Hamburgerfinger](#):
>
> You can generally do this with the Slicer RT extension

SlicerRT only supports a few RT application specific formats, so what you write is not quite true. I need to know what format it is in.

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 8:49pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/5 "2019-05-27T20:49:08Z")

</div>

The dose distribution is in text format, I use Penelope for MC simulation.

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 8:57pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/6 "2019-05-27T20:57:46Z")

</div>

The DICOM files are RT format (.dcm). I got the DVH from this file.  
My problem is the monte carlo dose. How to do to plot the DVH of the monte carlo dose simulated with Penelope?

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 9:02pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/7 "2019-05-27T21:02:01Z")

</div>

How to output the geometry? (my geometry is a voxel phantom)  
My idea is to convert the 3D dose distribution to DICOM format and with the help of the DVH functionality of Sliser RT i plot the DVH.

---

<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:** [May 27, 2019, 9:02pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/8 "2019-05-27T21:02:17Z")

</div>

> [@ToufikDZ](#):
>
> text format

Can I see such a file please? It might be quite simple to add a reader plugin for it, similarly to [this optical CT file format](https://github.com/SlicerRt/SlicerRT/tree/master/VffFileReader) for example.

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 9:04pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/9 "2019-05-27T21:04:22Z")

</div>

Text format is for the 3D dose distribution result from MC simulation and not CT file.

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 9:05pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/10 "2019-05-27T21:05:48Z")

</div>

How can I send it to you, please?

---

<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:** [May 27, 2019, 9:05pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/11 "2019-05-27T21:05:53Z")

</div>

> [@ToufikDZ](#):
>
> My idea is to convert the 3D dose distribution to DICOM format and with the help of the DVH functionality of Sliser RT i plot the DVH

- You can use the Dose Volume Histogram module to calculate and plot DVHs
- You don’t need to convert the dose to DICOM for DVH calculation, but you can if you want. You can export RT dose from the Data module, if the dose is under a study and is converted to dose volume

---

<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:** [May 27, 2019, 9:06pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/12 "2019-05-27T21:06:56Z")

</div>

> [@ToufikDZ](#):
>
> How can I send it to you, please?

Any file sharing service will do. We usually use Dropbox, OneDrive, or similar.

To another of your questions: the geometry will probably be in the header of the text file, same as in the case of the other importer I used as example above.

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 9:16pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/13 "2019-05-27T21:16:18Z")

</div>

For the first option: As far as I know, the dose volume (RT dose) and segmentation (RT structure) files are requered for the DVH to calculate and plot the DVHs, and these files can only be obtained from DICOM files.  
Please, tell me how can i plot the DVH with 3D dose distribution file.  
Thanks in advance.

---

<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:** [May 27, 2019, 9:21pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/14 "2019-05-27T21:21:20Z")

</div>

> [@ToufikDZ](#):
>
> tell me how can i plot the DVH with 3D dose distribution file

The dose does not need to come from DICOM. However, we need to read it from your file, for which probably we’ll need to add a new file loader. Please refer to my explanations above.

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 10:13pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/15 "2019-05-27T22:13:47Z")

</div>

Here is the file:  
[https://drive.google.com/open?id=1joK-fOnqvwOIyTPEQg4I8CrH3hYJpakT](https://drive.google.com/open?id=1joK-fOnqvwOIyTPEQg4I8CrH3hYJpakT)

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 27, 2019, 10:48pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/16 "2019-05-27T22:48:56Z")

</div>

I wonder how can this be done without volumes! the dose distribution file does not contain any geometry or volumes.

---

<div class="post-metadata">

**Author:** ![Hamburgerfinger](https://avatars.discourse-cdn.com/v4/letter/h/eb9ed0/32.png) [@Hamburgerfinger](https://discourse.slicer.org/u/Hamburgerfinger)\
**Post date:** [May 28, 2019, 12:05am UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/17 "2019-05-28T00:05:14Z")

</div>

You usually have to run a separate tally, or calculation mode to output the geometry from your MC program. I haven’t used the PENELOPE code, but for example in many particle transport  
codes, there is an option to sample the material number (integer) , or region ID (integer) number in the voxel mesh (instead, or at the same time as, the dose tally) – there should be a description of how to do this within  
PENELOPE’s documentation. Not sure if this helps, but how I usually make DVHs in Slicer is to:

a) run the dose simulation with the MC code to get 3D dose distribution which is imported into Slicer as a ‘volume’ (a reader may need to be made for it as cpinter mentioned)

b) run the geometry option with the MC code to get a voxel representation of the geometry, and import that into Slicer as a segmentation, or as a ‘labelmap’ which can be immediately converted to segmentation within Slicer

c) then calculate DVH within the DVH module of the slicer RT add-on

(Attachment mg\_info.txt is missing)

---

<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:** [May 28, 2019, 1:15pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/18 "2019-05-28T13:15:08Z")

</div>

> [@ToufikDZ](#):
>
> the dose distribution file does not contain any geometry or volumes

Dose distribution is typically a 3D image which we call volume in medical image computing. Is your data not a 3D image?

---

<div class="post-metadata">

**Author:** ![ToufikDZ](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ToufikDZ](https://discourse.slicer.org/u/ToufikDZ)\
**Post date:** [May 28, 2019, 3:21pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/19 "2019-05-28T15:21:40Z")

</div>

My data is 3D image.

---

<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:** [May 28, 2019, 3:40pm UTC](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930/20 "2019-05-28T15:40:41Z")

</div>

I don’t have access to the data you shared. I clicked on Request access, please let me know once you granted it and I can download it.

[Next page](https://discourse.slicer.org/t/convert-3d-dose-distribution-to-dicom-rt-dose/6930.md?page=2)
