# Get image intensity histogram of a segment

**URL:** https://discourse.slicer.org/t/get-image-intensity-histogram-of-a-segment/11277
**Category:** Development
**Created:** [April 23, 2020, 9:36pm UTC](https://discourse.slicer.org/t/get-image-intensity-histogram-of-a-segment/11277 "2020-04-23T21:36:28Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [April 24, 2020, 12:22am UTC](https://discourse.slicer.org/t/get-image-intensity-histogram-of-a-segment/11277/2 "2020-04-24T00:22:46Z")

</div>

You can get the histogram of a segment in 6 lines of Python code as shown **[here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-histogram-of-a-segmented-region)**. Just copy paste the example code into Slicer’s Python console to try it.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/4/24e85549325158434201593fd038a04879f81941.png)

---

_[View the full topic](https://discourse.slicer.org/t/get-image-intensity-histogram-of-a-segment/11277)._
