# Drawing dose volume histograms (DVHs)

**URL:** <https://root-forum.cern.ch/t/drawing-dose-volume-histograms-dvhs/44858>\
**Category:** Newbie\
**Created:** [May 13, 2021, 4:20pm UTC](https://root-forum.cern.ch/t/drawing-dose-volume-histograms-dvhs/44858 "2021-05-13T16:20:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [May 13, 2021, 4:20pm UTC](https://root-forum.cern.ch/t/drawing-dose-volume-histograms-dvhs/44858/1 "2021-05-13T16:20:13Z")

</div>

Hi  
I want to draw Dose Volume Histograms(DVHs).

I get TH3D dose distribution output from the geant4 Monte Carlo simulation.

I don’t know if there is a direct or simple way by ROOT for drawing DVHs.

I did some try on my own simple algorithm, I create a 1D dose histogram and count the minimum voxels for each bin but it not work and was not general and an efficient algorithm.

I appreciate it if someone has a better algorithm or a direct simple way for drawing DVH from TH3D dose distribution.

Many thanks,

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [May 15, 2021, 11:20am UTC](https://root-forum.cern.ch/t/drawing-dose-volume-histograms-dvhs/44858/2 "2021-05-15T11:20:04Z")

</div>

Hi,

I didn’t know what a DVH is, so I googled it. It looks like a simple TH1, doesn’t it? If so, could you maybe explain a bit more what is it you are trying to do? Maybe also share your algorithm and show exactly what isn’t working properly?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 15, 2021, 12:16pm UTC](https://root-forum.cern.ch/t/drawing-dose-volume-histograms-dvhs/44858/3 "2021-05-15T12:16:31Z")

</div>

You can project a 3-d histogram into 1-d or 2-d (also profile) histograms:  
[TH3::Project3D](https://root.cern/doc/master/classTH3.html#a94dd0a21d42fd95756e906e7f50fa293) ;  
[TH3::ProjectionX](https://root.cern/doc/master/classTH3.html#a6b8fe187592c6c36f5e443535a480af6) ;  
[TH3::ProjectionY](https://root.cern/doc/master/classTH3.html#a38e8e5a4a25027b1f399637b70afb8bd) ;  
[TH3::ProjectionZ](https://root.cern/doc/master/classTH3.html#a65ed465ab42638e18ba9ee50b14fa4ad) ;  
[TH3::Project3DProfile](https://root.cern/doc/master/classTH3.html#a6d7a16f7b0b13019e649a03f3ee35684)

---

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [May 17, 2021, 8:52pm UTC](https://root-forum.cern.ch/t/drawing-dose-volume-histograms-dvhs/44858/4 "2021-05-17T20:52:44Z")

</div>

hi Wile\_E\_Coyote and yus  
thanks for your reply,

DVHs is a 1-D histogram that represents the fraction of phantom(or any other structure) volume that received a certain or higher dose.

in my TH3D dose distribution, each bin represents a volume(voxel) and its content is “received dose”.

for drawing DVH we must define a 1D histogram with 100 bin in range 1 to 100( which are dose percents) and count the minimum number of voxels that their dose summation is equal to these dose bin.

thanks,  
Keyvan
