# How to match two dose distributions (TPS and Monte Carlo results) and CT images automatically (editing metadata tags)?

**URL:** <https://discourse.slicer.org/t/how-to-match-two-dose-distributions-tps-and-monte-carlo-results-and-ct-images-automatically-editing-metadata-tags/8074>\
**Category:** Support\
**Created:** [August 18, 2019, 12:44pm UTC](https://discourse.slicer.org/t/how-to-match-two-dose-distributions-tps-and-monte-carlo-results-and-ct-images-automatically-editing-metadata-tags/8074 "2019-08-18T12:44:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahrokh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shahrokh/32/1499_2.png) [@shahrokh](https://discourse.slicer.org/u/shahrokh)\
**Post date:** [August 18, 2019, 12:44pm UTC](https://discourse.slicer.org/t/how-to-match-two-dose-distributions-tps-and-monte-carlo-results-and-ct-images-automatically-editing-metadata-tags/8074/1 "2019-08-18T12:44:06Z")

</div>

Hi Dears 3DSlicer developers and users

My ultimate goal is to perform the **Gamma analysis** between two absorbed dose distributions using “Dose Comparison” module. These are the absorbed dose distributions obtained from calculations in the _Monte Carlo simulation_ (_PRIMO code, in text format_) and _Treatment Planning System_ (_ISOgray in DICOM RT-Dose format_).

It should be noted that the output file (absorbed dose distribution) of PRIMO code is in Text format. At firstly, it is converted to the Volume node using Python Interactor and then the Dose Volume node .

The specifics of these data are as follows.

> **CT** :
> 
> Image Dimensions: 512 x 512 x 89
> 
> Image Spacing: 0.962891mm x 0.962891mm x 5.000000mm

> **dose TPS** :
> 
> Image Dimensions: 62 x 46 x 88
> 
> Image Spacing: 5mm x 5mm x 5mm

> **dose PRIMO** :
> 
> Image Dimensions: 256 x 256 x 89
> 
> Image Spacing: 1.925782mm x 1.925782mm x 5.000000mm

The following figure is a demonstration of the current situation.

 ![Screenshot%20from%202019-08-18%2016-57-39](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/0/502cff95f7fde9069d8376ad48ae1af2f5798f28.jpeg)

**In the first step** , I want to match the two absorbed dose distributions and CT images with together. After doing it, I want to normalize them.

I **do not** want to use _manual transform methods_ to do this (this method is subjective).

I noticed in the following link that this may be possible to do matching (2 dose distribution and CT images) through editing metadata tags.

**Title** : VTK - Users - Matching CT and RT dose coordinates  
**Address** : http://vtk.1045678.n5.nabble.com/Matching-CT-and-RT-dose-coordinates-td3397428.html

As mentioned Scott Johnson in this link that “_If the FrameOfReferenceUIDs of the CT and the RT dose are the same, they both exist in the same coordinate system, if they don’t, you will have to register the dose to the CT somehow_”, Is this my understanding right?  
I think this is possible because as shown in the figure above, the images are physically the same size.  
In the other words, is it possible to match two absorbed dose distributions through the Metadata tags?

OR

Can I match this data (Dose volume node of the PRIMO absorbed dose distribution) by **Export to DICOM…** (in 3DSlicer) and then adding some tags (such as FrameOfReferenceUID) to DICOM files with software such as **DVTK** or **DicomBrowser** and finally loading it with **DICOM Browser** module in 3DSlicer?

I am waiting for your guidance.  
Please guide me.

---

<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 18, 2019, 1:43pm UTC](https://discourse.slicer.org/t/how-to-match-two-dose-distributions-tps-and-monte-carlo-results-and-ct-images-automatically-editing-metadata-tags/8074/2 "2019-08-18T13:43:14Z")

</div>

I don’t think you should manually register the dose volumes. It would not make sense, since this would not be an option if you computed the dose for a patient CT either.

Computed dose volumes must be spatially aligned with the CT volumes (therefore with each other, if you use the same CT) without any registration. If they don’t then it is a software bug that must be fixed.
