# Can I look at label intensity histograms with SimpleITK?

**URL:** https://discourse.itk.org/t/can-i-look-at-label-intensity-histograms-with-simpleitk/5634
**Category:** Beginner Questions
**Created:** [January 18, 2023, 11:12pm UTC](https://discourse.itk.org/t/can-i-look-at-label-intensity-histograms-with-simpleitk/5634 "2023-01-18T23:12:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Toby-Jackson](https://discourse.itk.org/user_avatar/discourse.itk.org/toby-jackson/32/2374_2.png) [@Toby-Jackson](https://discourse.itk.org/u/Toby-Jackson)
#### Post date: [January 18, 2023, 11:12pm UTC](https://discourse.itk.org/t/can-i-look-at-label-intensity-histograms-with-simpleitk/5634/1 "2023-01-18T23:12:33Z")

</div>

I have a label map and and corresponding image and would like to look at the intensity histograms for each or each label, I know that there is an intensity histogram being calculated behind the scenes, for example in sitk.LabelIntensityImageFilter() but I don’t know how to to access the underlying itk.Histogram object, so I can get the corresponding counts, and limits on the bins.

I would prefer to develop in SimpleITK, but am happy to use the python wrappers for itk if that is the best way to do this.

I realise that I could do this with numpy but if possible it would be nice to stay with SimpleITK.

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [January 20, 2023, 2:16pm UTC](https://discourse.itk.org/t/can-i-look-at-label-intensity-histograms-with-simpleitk/5634/2 "2023-01-20T14:16:36Z")

</div>

Hello @Toby-Jackson,

Unfortunately, this cannot be done in SimpleITK. This is a “feature”. Part of the simplification design includes hiding underlying complexity from the user.

In this case, you will need to use ITK or numpy. If working with numpy, use `GetArrayViewFromImage` to avoid the memory copy done in `GetArrayFromImage`.
