# Plotting MRI intensity histogram from a segmentation

**URL:** <https://discourse.slicer.org/t/plotting-mri-intensity-histogram-from-a-segmentation/31618>\
**Category:** Support\
**Created:** [September 8, 2023, 1:49pm UTC](https://discourse.slicer.org/t/plotting-mri-intensity-histogram-from-a-segmentation/31618 "2023-09-08T13:49:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SHADI](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@SHADI](https://discourse.slicer.org/u/SHADI)\
**Post date:** [September 8, 2023, 1:49pm UTC](https://discourse.slicer.org/t/plotting-mri-intensity-histogram-from-a-segmentation/31618/1 "2023-09-08T13:49:43Z")

</div>

Operating system: Windows 10  
Slicer version:5.4  
Expected behavior  
how can I plot an intensity histogram using 3Dslicer?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 8, 2023, 4:52pm UTC](https://discourse.slicer.org/t/plotting-mri-intensity-histogram-from-a-segmentation/31618/2 "2023-09-08T16:52:08Z")

</div>

Histogram rarely contains information that is relevant for end users, so we haven’t created a GUI for this feature, but you can get it by a few lines of Python code. See a complete example (including generating sample data, computing the histogram, and plotting the result) in the [script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-histogram-of-a-segmented-region).
