# Segment Statistics does nothing?

**URL:** <https://discourse.slicer.org/t/segment-statistics-does-nothing/1143>\
**Category:** Support\
**Created:** [September 29, 2017, 8:49pm UTC](https://discourse.slicer.org/t/segment-statistics-does-nothing/1143 "2017-09-29T20:49:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [September 29, 2017, 8:49pm UTC](https://discourse.slicer.org/t/segment-statistics-does-nothing/1143/1 "2017-09-29T20:49:17Z")

</div>

This is on the 9/28 MacOS nightly. Segment Statistics doesn’t do any calculations - just brings up quantitative window with no output. Anybody else see this or is it just me?

Thanks!

-Hollister

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [September 29, 2017, 8:52pm UTC](https://discourse.slicer.org/t/segment-statistics-does-nothing/1143/2 "2017-09-29T20:52:10Z")

</div>

Make that 9/27 nightly, and also fails on 9/8 nightly.

Error traceback:

Traceback (most recent call last):  
File “/Users/hherhold/Desktop/Slicer.app/Contents/lib/Slicer-4.7/qt-scripted-modules/SegmentStatistics.py”, line 183, in onApply  
self.logic.computeStatistics()  
File “/Users/hherhold/Desktop/Slicer.app/Contents/lib/Slicer-4.7/qt-scripted-modules/SegmentStatistics.py”, line 420, in computeStatistics  
self.updateStatisticsForSegment(segmentID)  
File “/Users/hherhold/Desktop/Slicer.app/Contents/lib/Slicer-4.7/qt-scripted-modules/SegmentStatistics.py”, line 429, in updateStatisticsForSegment  
if not segmentationNode.GetSegmentation().GetSegment(segmentID):  
AttributeError: ‘vtkCommonCorePython.vtkObject’ object has no attribute ‘GetSegment’

---

<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 29, 2017, 10:17pm UTC](https://discourse.slicer.org/t/segment-statistics-does-nothing/1143/3 "2017-09-29T22:17:25Z")

</div>

Thank you for reporting this. I could reproduce this error and fixed it.

The problem was that in certain scenarios it was possible to get to method in SegmentStatistics module that used vtkSegmentationCore before it was imported. We haven’t detected this issue either in our automatic tests or when manually used the feature because when you run Segment Editor then it imports the library and the error does not occur.

@jcfr - it is yet another example why fixing [https://issues.slicer.org/view.php?id=4385](https://issues.slicer.org/view.php?id=4385) would be important. It would be great if you could have a look at it

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [September 29, 2017, 11:51pm UTC](https://discourse.slicer.org/t/segment-statistics-does-nothing/1143/4 "2017-09-29T23:51:08Z")

</div>

Got it. Thanks!!!

-Hollister
