Use of dicompyler-core dvh.DVH.from_data()

116 views
Skip to first unread message

Matt B

unread,
Jan 11, 2017, 8:48:55 AM1/11/17
to dicompyler
Hi,

I am trying to access and use the from_data() function within dicompyler-core.

I am supplying my cumulative DVH data as a list and specifying the binsize = 1 (cGy) as 
my_dvh =dvh.DVH.from_data(data=dvh_list,binsize=1)

This is producing a DVH object with the following properties:
DVH(cumulative, 100 bins: [0.0:100.0] Gy, volume: 5325 cm3, name: None, rx_dose: 0 Gy)

Running my_dvh.plot() produced the following:

but the cumulative DVH plot should be (based on plotting from the raw data):


So I was wondering if I am passing in the data incorrectly or misunderstanding the use of the from_data function. WHat format should the data that I pass tot he function be in?
Also, is there a way to specify the prescription dose?

Many thanks,

Matt
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Roy

unread,
Jan 11, 2017, 2:30:27 PM1/11/17
to dicompyler
Hi Matt,

It looks like it's plotting a differential DVH instead of a cumulative one.

As far as I can tell, the from_data function expects raw dose distribution data, i.e. each entry in the array is the dose of a single voxel in a dose distribution. It then uses that raw dose distribution to calculate a differential DVH. If you gave it cDVH data, it would probably generate a differential histogram, whose plot would be similar to the one you generated via dvh.plot().

I suspect Adit will chime in with better answers :)

Roy

Aditya Panchal

unread,
Jan 11, 2017, 4:01:37 PM1/11/17
to dicom...@googlegroups.com
Hi Matt,

Roy is correct. `from_data` expects a raw dose array and will calculate a histogram and the number of bins (and bin size) for you based on this data passed in.

In your case, it would be better to instantiate the DVH class directly and pass
- the cumulative dose histogram counts as the counts argument
- the actual bins as the bins argument
- the rx dose as the rx_dose argument

i.e. dvh.DVH(counts=dvh_list, bins=np.arange(0, len(dvh_list) + 1)

See the DVH class initialization method for more information as all the parameters are documented:


I originally created the from_dvh class method when I first designed the DVH class, but quickly found that I didn't really use it after making the initializer more versatile. I figured someone might use this functionality when needing to calculate a DVH from raw dose data and did not remove it from the final class.

Hope that helps,

Adit

--
-- 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.

Matt B

unread,
Jan 12, 2017, 4:20:28 AM1/12/17
to dicompyler
Hi,

Thanks you, that works great.

Cheers,

Matt


--
-- 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.
Reply all
Reply to author
Forward
0 new messages