# How to adjust DVH bin width?

**URL:** <https://discourse.slicer.org/t/how-to-adjust-dvh-bin-width/40088>\
**Category:** Support\
**Tags:** radiotherapy\
**Created:** [November 9, 2024, 4:24am UTC](https://discourse.slicer.org/t/how-to-adjust-dvh-bin-width/40088 "2024-11-09T04:24:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilbysl](https://avatars.discourse-cdn.com/v4/letter/w/bcef8e/32.png) [@wilbysl](https://discourse.slicer.org/u/wilbysl)\
**Post date:** [November 9, 2024, 4:24am UTC](https://discourse.slicer.org/t/how-to-adjust-dvh-bin-width/40088/1 "2024-11-09T04:24:40Z")

</div>

Hello.  
Can anyone tell me if it’s possible to change the bin width for DVHs in v5.6.2 of Slicer3D please?  
Many thanks

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 14, 2024, 1:35pm UTC](https://discourse.slicer.org/t/how-to-adjust-dvh-bin-width/40088/2 "2024-11-14T13:35:53Z")

</div>

There is no option for this on the GUI. However, you have the possibility to change it from Python using these functions:

> <https://github.com/SlicerRt/SlicerRT/blob/master/DoseVolumeHistogram/Logic/vtkSlicerDoseVolumeHistogramModuleLogic.h#L125-L129>

The code you need to run in the Python console is

```auto
dvhLogic = slicer.modules.dosevolumehistogram.logic()
dvhLogic.SetStartValue(0.1)
dvhLogic.SetStepSize(0.2)

```

Obviously you need to changes these values. The above numbers are the defaults.

If you want this to be persistent every time you start Slicer, you can add this to the `.slicerrc.py` file.

---

<div class="post-metadata">

**Author:** ![wilbysl](https://avatars.discourse-cdn.com/v4/letter/w/bcef8e/32.png) [@wilbysl](https://discourse.slicer.org/u/wilbysl)\
**Post date:** [November 20, 2024, 2:00pm UTC](https://discourse.slicer.org/t/how-to-adjust-dvh-bin-width/40088/3 "2024-11-20T14:00:25Z")

</div>

Thank you Csaba, that’s very helpful. I will give it a try.

Best wishes

Sarah
