# Is there any way to get LabelStatistics to the python?

**URL:** <https://discourse.slicer.org/t/is-there-any-way-to-get-labelstatistics-to-the-python/7115>\
**Category:** Development\
**Created:** [June 10, 2019, 7:56pm UTC](https://discourse.slicer.org/t/is-there-any-way-to-get-labelstatistics-to-the-python/7115 "2019-06-10T19:56:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![batuhan\_edguer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/batuhan_edguer/32/3517_2.png) [@batuhan\_edguer](https://discourse.slicer.org/u/batuhan_edguer)\
**Post date:** [June 10, 2019, 7:56pm UTC](https://discourse.slicer.org/t/is-there-any-way-to-get-labelstatistics-to-the-python/7115/1 "2019-06-10T19:56:39Z")

</div>

![Ek%20A%C3%A7%C4%B1klama%202019-06-10%20225453](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/1/b1536a8dca775ac051f75ccb41850a07baa73bb7.png)  
I want to get these datas to the script for GUI development.  
Is there any command to get these datas?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 11, 2019, 8:57pm UTC](https://discourse.slicer.org/t/is-there-any-way-to-get-labelstatistics-to-the-python/7115/2 "2019-06-11T20:57:38Z")

</div>

Yes - you can access the LabelStatisticsLogic and you can calculate these values. (Note that in newer Slicer we suggest using Segment Statistics, which is similar).

> <https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/LabelStatistics/LabelStatistics.py#L278-L380>
