tar files to DICOM

1,619 views
Skip to first unread message

Andrew Alexander

unread,
May 3, 2017, 3:46:26 PM5/3/17
to pinnacle3-users
We have been working on writing a python script to convert pinnacle tar files to DICOM files. We have been able to convert the images, structures, and plan. Does anyone know how the dose information is stored within pinnacle? There is a list of files named "plan.Trail.binary.000"  to  "plan.Trail.binary.020". I assume those files are the dose files. Is this correct and does anyone know how those binary files are written? 

Once successfully we will be releasing this script to the community for others to use.

thanks
Andrew

rico leo

unread,
May 3, 2017, 4:22:27 PM5/3/17
to pinnacl...@googlegroups.com
Any more detail of your program?  Everything that you mention could export from Pinnacle, for example, you can export dose as RTDOSE. As I know Pinnacle can export RTPLAN, RTStructure, RTDOSE and DICOM CT images.

Rico

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.
To post to this group, send email to pinnacle3-users@googlegroups.com
To subscribe to this group, send email to
pinnacle3-users+subscribe@googlegroups.com
To unsubscribe from this group, send email to
pinnacle3-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kantor,Michael E

unread,
May 3, 2017, 4:29:12 PM5/3/17
to pinnacl...@googlegroups.com

Those files hold 4-byte single precision floats, the total number of them equals the total number of voxels in the Trial.

 

Some are beam doses, some are trial dose. Some are in units of cGy/MU, others are in cGy.

 

You can learn more about them by looking at the XDR lines in plan.Trial.

 

Thanks,

Mike Kantor

--

--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.

To post to this group, send email to pinnacl...@googlegroups.com


To subscribe to this group, send email to


To unsubscribe from this group, send email to


For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-use...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.

Andrew Alexander

unread,
May 3, 2017, 5:07:49 PM5/3/17
to pinnacle3-users
Thanks Mike! I will look into that.

Andrew

Andrew Alexander

unread,
May 3, 2017, 5:07:54 PM5/3/17
to pinnacle3-users
Hi Rico,

Yes that is true. We could load all these tar files back into Pinnacle and DICOM export from Pinnacle. As far as I can tell that is a manual process and it would take someone many hours to do. We have been using Pinnacle for a long time and so most of our Pinnacle patients have been archived outside of Pinnacle to free up storage drive. Writing a script seems like an elegant method to convert these 10k patients into a standard radiotherapy format that can be used for years to come, long after Pinnacle. 




On Wednesday, 3 May 2017 14:22:27 UTC-6, Rico wrote:
Any more detail of your program?  Everything that you mention could export from Pinnacle, for example, you can export dose as RTDOSE. As I know Pinnacle can export RTPLAN, RTStructure, RTDOSE and DICOM CT images.

Rico
On Wed, May 3, 2017 at 10:11 AM, Andrew Alexander <andrew.a...@gmail.com> wrote:
We have been working on writing a python script to convert pinnacle tar files to DICOM files. We have been able to convert the images, structures, and plan. Does anyone know how the dose information is stored within pinnacle? There is a list of files named "plan.Trail.binary.000"  to  "plan.Trail.binary.020". I assume those files are the dose files. Is this correct and does anyone know how those binary files are written? 

Once successfully we will be releasing this script to the community for others to use.

thanks
Andrew

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.
To post to this group, send email to pinnacl...@googlegroups.com

To subscribe to this group, send email to

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-use...@googlegroups.com.

Yves BARBOTTEAU

unread,
May 4, 2017, 1:05:59 AM5/4/17
to pinnacl...@googlegroups.com
Hi Andrew,

Your idea is very brillant. I'm impatient to get your script and play with it. 

Yves. 

Envoyé de mon iPhone

Kantor,Michael E

unread,
May 4, 2017, 10:30:37 AM5/4/17
to pinnacl...@googlegroups.com

There is some complexity to it, but it can be done.

 

I have such a system in place, but it automates Pinnacle for DICOM export instead of attempting conversion, and also verifies the Trial beams against what was delivered according to the R&V.

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.

Alex

unread,
May 4, 2017, 10:52:22 AM5/4/17
to pinnacle
Michael,

Do you loose anything by export to DICOM and then import plan back into Pinnacle?  With tar file, you can include beam model -- I figure this is probably not possible with DICOM.

If the answer is no then this maybe an efficient way to backup plans, even w/o physics data.

Alex


To post to this group, send email to pinnacle3-users@googlegroups.com


To subscribe to this group, send email to


To unsubscribe from this group, send email to


For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-users+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.

To post to this group, send email to pinnacle3-users@googlegroups.com


To subscribe to this group, send email to


To unsubscribe from this group, send email to


For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-users+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.
To post to this group, send email to pinnacle3-users@googlegroups.com

To subscribe to this group, send email to

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-users+unsubscribe@googlegroups.com.

Kantor,Michael E

unread,
May 4, 2017, 11:00:51 AM5/4/17
to pinnacl...@googlegroups.com

I’m not concerned with the beam model for several reasons:

-          Going to DICOM RTPLAN means I want TPS-independent data anyway.

-          Many Trials use old beam models from old Pinnacle versions which aren’t very useful right now, especially for versions which were SPARC-only.

-          The .tar files still remain in storage if they’re needed later, so beam models are available if there is a desire to re-commission.

 

It would be nice if the DICOM standard were expanded to allow import/export of beam models across platforms, but I don’t ever see that happening since the modeling is so different across TPSs.

 

From: pinnacl...@googlegroups.com [mailto:pinnacl...@googlegroups.com] On Behalf Of Alex
Sent: Thursday, May 4, 2017 9:52 AM
To: pinnacle <pinnacl...@googlegroups.com>
Subject: Re: [p3rtp] tar files to DICOM

 

Michael,

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.

The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.

Andrew Alexander

unread,
May 4, 2017, 5:10:46 PM5/4/17
to pinnacle3-users

I was able to determine that yes, the number of voxels times 4 bytes per voxel, does in fact match the file size for these binary files.  My next question would be why are there so many binary files in the plan folder? In addition there seems to be a set of different file sizes for each binary file. For the example that I have provided in the image below, only the file sizes of 3,667 KB match the number of voxels for the calculated dose distribution. One possible reason for this would be that those are the dose distributions per field. As such I would have to sum each of the 3,667 KB files to get the planned dose distribution. Does that make sense to you Mike? 








Thanks
Andrew

Kantor,Michael E

unread,
May 4, 2017, 5:34:49 PM5/4/17
to pinnacl...@googlegroups.com

Each Beam has 2 files for its dose, I believe one has values of cGy/MU and the other is cGy. These correspond to DoseVarVolume and DoseVolume keys on the Beam. If you’ve got cGy you’re in luck, because MU is not saved in plan.Trial.

 

Depending on the Plan/Trial settings Control Points could have dose files as well.

 

Other smaller files are rendered BEVs/DRRs and other various internal things. They should all have some XDR reference in plan.Trial.

Mickaël Colet

unread,
May 24, 2017, 10:22:28 PM5/24/17
to pinnacle3-users
Hi Michael,

I am very interrested about automating Pinnacles for DICOM export.
Could you share your scripts ?

Thanks in advance

Regards

Mickaël

Andrew Alexander

unread,
May 31, 2017, 1:54:38 AM5/31/17
to pinnacle3-users
We are still working on normalizing the dose distribution. Once we are happy with the results, it'll be available for others to use.

You received this message because you are subscribed to a topic in the Google Groups "pinnacle3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pinnacle3-users/3eLGYAX50o0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pinnacle3-use...@googlegroups.com.

Kantor,Michael E

unread,
May 31, 2017, 12:02:22 PM5/31/17
to pinnacl...@googlegroups.com

I’m not able to share my scripts because they’re owned by my employer. I may be able to make a conversion service available in the near future.

 

Thank you,

Mike Kantor

Andrew Alexander

unread,
Aug 17, 2017, 12:37:06 PM8/17/17
to pinnacle3-users
I think we have solved most of the issues with MUs and dose determination. The script seems to work well.

However, for a few patients, under Pinnacle version 7.6, we do not have the DICOM images within the patient folder. Instead, there is a single binary file called ImageSet_0.img 
Does anyone know how that file is formatted? The size of the file corresponds to the number of row, columns, and slices times 8 bytes per pixel.

Johnson Yuen

unread,
Sep 11, 2017, 7:42:13 PM9/11/17
to pinnacl...@googlegroups.com
Hi Andrew

Your project is very interesting and relevant as we are thinking of tar files too. Currently we are going to test Varian velocity who claim to be able to convert tar to dicom plan and dose..

I'm somewhat wary of them as they do not have manuals or reference guides. 

Would your group be publishing your method and results as that would be of interest to see what all the issues are as what solutions sites need to think of.  Did your group find any good references regarding checks for dicom dose conversion? 

Thank you for your time

Johnson Yuen 


To post to this group, send email to pinnacle3-users@googlegroups.com

To subscribe to this group, send email to

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-users+unsubscribe@googlegroups.com.

Andrew Alexander

unread,
Sep 14, 2017, 1:36:47 AM9/14/17
to pinnacl...@googlegroups.com
The code seems to work for most of our patients, but I am not sure how general our solution is. What I would like to do is release the code on GitHub so that others can download try it out and submit changes to make it more universal. 

There are a few variables that are unique to individual machine calibration values, such as determining the MUs. 

Andrew

You received this message because you are subscribed to a topic in the Google Groups "pinnacle3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pinnacle3-users/3eLGYAX50o0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pinnacle3-use...@googlegroups.com.

Andrew Alexander

unread,
Oct 5, 2017, 4:44:08 PM10/5/17
to pinnacle3-users

martj...@gmail.com

unread,
Oct 14, 2017, 11:30:14 AM10/14/17
to pinnacle3-users
Hello Andrew,
have you a readme doc with some instructions about how to use the script?
Sorry for the question but we are new to python scripting.
Thanks a lot,
Martjin.

Harzée Ludovic

unread,
Oct 15, 2017, 11:58:41 AM10/15/17
to pinnacl...@googlegroups.com
Hi Andrew

My colleague of IT has tested your script. He had some problems. The structure set is shifted and the Rt dose is not present? Is it normal?

Ludovic




De : pinnacl...@googlegroups.com [pinnacl...@googlegroups.com] de la part de martj...@gmail.com [martj...@gmail.com]
Envoyé : samedi 14 octobre 2017 17:30
À : pinnacle3-users
Objet : Re: [p3rtp] tar files to DICOM

Andrew Alexander

unread,
Oct 17, 2017, 12:21:12 PM10/17/17
to pinnacle3-users
Hi Ludovic and Martjin,

Thanks for trying out the code. I have started to write a guide on the GitHub page that describes how to setup the script.

Please submit bug reports or issues with the code on GitHub. The best way to track issues and resolve them is through a version control software package like GitHub. Overtime the code can be edited to have a more general solution to various problems. 
It will get messy fast if we use this form to discuss code edits and bug fixes. 

In general, a shifted structure set is easy to fix.
As for the RT dose files, that could depend on a number of issues (do the files exits within the plan folder, what version of pinnacle the export was written in, etc ... ) 

I do not experience these issues with my tar files, but the code was written and tested on my tar files so that's not surprising. 

Andrew

Nitin Kumar

unread,
Nov 16, 2017, 2:15:30 PM11/16/17
to pinnacle3-users
Hi Andrew,
I downloaded your script and got it to run to the point where I get the DICOM image files created.  I tried to figure out the order in which to run the rest of the modules. Can you provide some insight on how to extract the RTDOSE file?  Thanks.

-Nitin

Andrew Alexander

unread,
Dec 2, 2017, 11:51:43 PM12/2/17
to pinnacl...@googlegroups.com
Hi Nitin,

The code was written to write the dose files automatically. If this is not happening for your case, please submit an issue to the github site. In the description of the issue please include sufficient information to diagnosis the issue.

Thanks
Andrew

You received this message because you are subscribed to a topic in the Google Groups "pinnacle3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pinnacle3-users/3eLGYAX50o0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pinnacle3-use...@googlegroups.com.

Nitin Kumar

unread,
Jan 11, 2018, 2:17:27 PM1/11/18
to pinnacle3-users
Thanks, Andrew.  I just did that.

achraf touzani

unread,
Apr 20, 2018, 1:50:32 PM4/20/18
to pinnacle3-users
Hi Andrew,

First, thanks for your work, that is really useful and a great package for python.
I was reading your code and if i may i have an observation about MU calculation:

beammu = float(re.findall(r"[-+]?\d*\.\d+|\d+", line)[0])/(normdose*PDD6MV)
 
The Collimator Output Factor is not include in the formula what generate a RTPlan with different MU from Pinnacle, by adding OFc finally i get the same MU.

Regards,

Achraf

Andrew Alexander

unread,
Apr 24, 2018, 2:00:14 PM4/24/18
to pinnacl...@googlegroups.com
Hi Achraf,

Thanks for looking into the issue, this is what I enjoy about open source projects. The formula that you adjusted is my quick and dirty way to calculate the MUs for the each beam. I would have preferred a more robust method to get the MUs, but they do not seem to be readily available in any of the files per plan. In general, how are you sourcing the OFc values? Is the OFc value available within the plan files? 

Thanks
Andrew

--

achraf touzani

unread,
Apr 25, 2018, 10:34:49 AM4/25/18
to pinnacl...@googlegroups.com
In plan.Trial file in MonitorUnitInfo you have the " CollimatorOutputFactor" for each beam, it is two lines under NormalizedDose. In createDicom.py line 1570, under :
normdose = float(re.findall(r"[-+]?\d*\.\d+|\d+", all_lines[linenum + 15])[0])
i added :
OFc = float(re.findall(r"[-+]?\d*\.\d+|\d+", all_lines[linenum + 17])[0])
and for the MU calculation 
beammu = float(re.findall(r"[-+]?\d*\.\d+|\d+", line)[0])/(normdose*PDD6MV*OFc) 

I have tested some patients and it seems to be ok

Regards,

Achraf
 

2018-04-24 19:59 GMT+02:00 Andrew Alexander <andrew.a...@gmail.com>:
Hi Achraf,

Thanks for looking into the issue, this is what I enjoy about open source projects. The formula that you adjusted is my quick and dirty way to calculate the MUs for the each beam. I would have preferred a more robust method to get the MUs, but they do not seem to be readily available in any of the files per plan. In general, how are you sourcing the OFc values? Is the OFc value available within the plan files? 

Thanks
Andrew

On Fri, 20 Apr 2018 at 11:50 achraf touzani <touzani...@gmail.com> wrote:
Hi Andrew,

First, thanks for your work, that is really useful and a great package for python.
I was reading your code and if i may i have an observation about MU calculation:

beammu = float(re.findall(r"[-+]?\d*\.\d+|\d+", line)[0])/(normdose*PDD6MV)
 
The Collimator Output Factor is not include in the formula what generate a RTPlan with different MU from Pinnacle, by adding OFc finally i get the same MU.

Regards,

Achraf
 

Le mercredi 3 mai 2017 21:46:26 UTC+2, Andrew Alexander a écrit :
We have been working on writing a python script to convert pinnacle tar files to DICOM files. We have been able to convert the images, structures, and plan. Does anyone know how the dose information is stored within pinnacle? There is a list of files named "plan.Trail.binary.000"  to  "plan.Trail.binary.020". I assume those files are the dose files. Is this correct and does anyone know how those binary files are written? 

Once successfully we will be releasing this script to the community for others to use.

thanks
Andrew

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.
To post to this group, send email to pinnacle3-users@googlegroups.com

To subscribe to this group, send email to

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "pinnacle3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pinnacle3-users/3eLGYAX50o0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pinnacle3-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
You received this message because you are subscribed to the Google
Groups "pinnacle3-users" group.
To post to this group, send email to pinnacle3-users@googlegroups.com

To subscribe to this group, send email to

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/pinnacle3-users?hl=en

---
You received this message because you are subscribed to the Google Groups "pinnacle3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pinnacle3-users+unsubscribe@googlegroups.com.

Foschepoth, Simon

unread,
Nov 2, 2020, 9:54:12 AM11/2/20
to pinnacl...@googlegroups.com

Hi Andrew and list,

 

I hope you still follow this group, since your email Address in the conversation is no longer valid.

We adapted your Script and could save nearly all of our old backups. Thank you so much for the work!

 

Did you ( or anyone here) solve the problem of the combined CT file (ImageSet_0.img)  in Patients backuped with old Versions at some point?

 

Best regards

Simon

--


Simon Foschepoth M.Sc.
Medizinphysik-Experte

Klinik für Strahlentherapie
Malteser Krankenhaus St. Franziskus Hospital
Waldstraße 17, D-24939 Flensburg

Telefon +49(0)461 816 2728
Telefax +49(0)461 816 2018
Email
simon.fo...@malteser.org




Malteser Norddeutschland gGmbH
Sitz: Flensburg, AG Flensburg HRB 3419 FL
Geschaeftsfuehrer: Verena Hölken,
Dipl.-Kfm. Klaus Deitmaring,
Roland Niles
www.malteser-franziskus.de

Andrew Alexander

unread,
Nov 8, 2020, 1:15:24 PM11/8/20
to pinnacle3-users
Hi Simon,

I am happy to hear that this script was useful to you and your department. The script has evolved and has been ported it to pymedphys by Phillip Chlap. Phillip was able to resolve the proper MUs per beam. 
As for myself, I have not worked on this script in some time. Perhaps the issue of multiple datasets has been resolved  within pymedphys. 

All the best
Andrew

You received this message because you are subscribed to a topic in the Google Groups "pinnacle3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pinnacle3-users/3eLGYAX50o0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pinnacle3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pinnacle3-users/72f7b0f0a0194adf978ac735b260c9ef%40V0DMEX013.Malteser.de.
Reply all
Reply to author
Forward
0 new messages