DVH Calculation based on Dose Summation Type = MULTI_PLAN or BEAM

118 views
Skip to first unread message

priya...@gmail.com

unread,
Oct 31, 2017, 9:47:35 AM10/31/17
to dicompyler
Hi

I there a way to clalculate DVH if Dose Summation Type = MULTI_PLAN or BEAM
So 1 RT Struct file and 2 or more RT Dose file for instance.


Dose Summation Type (3004,000A) data element specifies the scope (level of treatment plan hierarchy) of the dose represented in an RT Dose instance. The Dose Summation Type may be an entire RT Plan (PLAN), two or more RT Plans (MULTI_PLAN), a single fraction group (FRACTION), one or more Beams within an RT Plan (BEAM), one or more Brachy Application Setups within an RT Plan (BRACHY), or one or more Control Points within a Beam (CONTROL_POINT).

Aditya Panchal

unread,
Oct 31, 2017, 10:16:59 AM10/31/17
to dicom...@googlegroups.com
Hi Priyanka,

You can manually sum the dose grids and then re-create a new DICOM object which can be used by dicompylercore/dvhcalc.

That is my current method.

Aditya

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en
---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

priya...@gmail.com

unread,
Nov 6, 2017, 6:25:06 AM11/6/17
to dicompyler
Hi Aditya, thanks for the suggesstion.


sum_dcm.pixel_array = sum
sum_dcm.BitsAllocated = 32
sum_dcm.BitsStored = 32
sum_dcm.HighBit = 31
sum_dcm.PixelData = sum.tostring()
sum_dcm.DoseGridScaling = sum_scaling

Just wanted to understand , if its a bug. 

I get an error on this line : sum_dcm.pixel_array = sum

As per DICOM documentation, you can read pixel array attribute but to save, you need to update , PixelData attribute.
- show quoted text -

On Tuesday, October 31, 2017 at 3:16:59 PM UTC+1, Aditya Panchal wrote:
Hi Priyanka,

You can manually sum the dose grids and then re-create a new DICOM object which can be used by dicompylercore/dvhcalc.

That is my current method.

Aditya
On Tue, Oct 31, 2017 at 1:47 PM, <priya...@gmail.com> wrote:
Hi

I there a way to clalculate DVH if Dose Summation Type = MULTI_PLAN or BEAM
So 1 RT Struct file and 2 or more RT Dose file for instance.


Dose Summation Type (3004,000A) data element specifies the scope (level of treatment plan hierarchy) of the dose represented in an RT Dose instance. The Dose Summation Type may be an entire RT Plan (PLAN), two or more RT Plans (MULTI_PLAN), a single fraction group (FRACTION), one or more Beams within an RT Plan (BEAM), one or more Brachy Application Setups within an RT Plan (BRACHY), or one or more Control Points within a Beam (CONTROL_POINT).

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en

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

Stephen Terry

unread,
Nov 6, 2017, 6:38:17 AM11/6/17
to dicom...@googlegroups.com
Priyanka,

The plan sum extension is one that I wrote, so I have to take the blame for this.  Can you tell me what error you are getting?

priya...@gmail.com

unread,
Nov 7, 2017, 10:42:30 AM11/7/17
to dicompyler
Hi Stephen,

Sorry for the mixup. 
The error is : can't set attribute for line # sum_dcm.pixel_array = sum
If i comment this line, everything works fine.

priya...@gmail.com

unread,
Nov 7, 2017, 10:45:12 AM11/7/17
to dicompyler
PlanSum: Using direct summation

priya...@gmail.com

unread,
Nov 8, 2017, 4:51:57 AM11/8/17
to dicompyler
I have a DVH calculation related error too.

here it is.

I calculate DVH for Brainstem and CHIASM ROI's
for Brainstem, i do get the DVH from dicompylercore and our own application.
#DVH(cumulative, 303 bins: [0.0:3.0299999999999998] Gy, volume: 25.999999999999982 cm3, name: 'BRAINSTEM', rx_dose: 0 Gy)
#dicompylercore has vol = 26.0 , mean = 0.504, max= 3.02, min = 0.05
#Other application has vol = 25.918, mean=0.710, max=3.664, min = 0.0546

But for CHIASM, I dont get lot of values like min , max etc from dicompylercore.
#DVH(cumulative, 4 bins: [0.0:0.040000000000000001] Gy, volume: 0.0 cm3, name: 'CHIASM', rx_dose: 0 Gy)
#Other application has vol = 0.3774, mean=0.0530, max= 0.0605, min = 0.044


calcdvh = dvhcalc.get_dvh(destinationfolder+"\\RTStruct.dcm", destinationfolder+"\\RTDose.dcm", 4)
print(calcdvh)
calcdvh = dvhcalc.get_dvh(destinationfolder+"\\RTStruct.dcm", destinationfolder+"\\RTDose.dcm", 7)
print(calcdvh)
print('end')

Please find the RTStruct and RTDose files for debugging
#BRAINSTEM=4
#CHIASM = 7

DVHError.jpg
RTDose.dcm

priya...@gmail.com

unread,
Nov 8, 2017, 4:53:05 AM11/8/17
to dicompyler
Adding RTStruct file


On Tuesday, October 31, 2017 at 2:47:35 PM UTC+1, priya...@gmail.com wrote:
RTStruct.dcm

Stephen Terry

unread,
Nov 10, 2017, 9:02:25 AM11/10/17
to dicom...@googlegroups.com
Priyanka,

You can download an updated version of the plugin from my Github repository.  It should fix this issue.  It may only work with Python3 though.  I'm still testing it under 2.7.


Steve

--

priya...@gmail.com

unread,
Nov 13, 2017, 4:04:34 AM11/13/17
to dicompyler
Thanks Steve for the fix. It works great and I am running it on Python 3 :)

I hope the DVH issue, Aditya can take a look now.

Cheers
Priyanka

Aditya Panchal

unread,
Nov 13, 2017, 2:30:06 PM11/13/17
to dicom...@googlegroups.com
Hi Priyanka,

The optic nerve is too small relative to the dose grid. The way I have worked around this is to interpolate the RT dose file to a smaller grid resolution (or export from the TPS a smaller dose grid resolution).

That is why it can't calculate a DVH (or a volume) because the points of the structure are smaller than a dose grid voxel.

I am doing some work on this now, but it's not really ready to integrate into dicompyler-core yet.

You may be able to reuse some of the plan sum code to interpolate the dose grid to a smaller resolution.

Hope that helps,

Aditya

--
-- You received this message because you are subscribed to the Google Groups dicompyler group. To post to this group, send email to dicom...@googlegroups.com. To unsubscribe from this group, send email to dicompyler+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/dicompyler?hl=en

---
You received this message because you are subscribed to the Google Groups "dicompyler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dicompyler+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages