parameters: (self)
docstring: Compute statistical measures for all (visible) segments
docstring_summary: Compute statistical measures for all (visible) segments
docstring_tokens: Compute statistical measures for all ( visible ) segments
function: def computeStatistics(self):
      """Compute statistical measures for all (visible) segments"""
      self.reset()
  
      segmentationNode = slicer.mrmlScene.GetNodeByID(self.getParameterNode().GetParameter("Segmentation"))
  
      # Get segment ID list
      visibleSegmentIds = vtk.vtkStringArray()
      if self.getParameterNode().GetParameter('visibleSegmentsOnly')=='True':
        segmentationNode.GetDisplayNode().GetVisibleSegmentIDs(visibleSegmentIds)
      else:
        segmentationNode.GetSegmentation().GetSegmentIDs(visibleSegmentIds)
      if visibleSegmentIds.GetNumberOfValues() == 0:
        logging.debug("computeStatistics will not return any results: there are no visible segments")
  
      # update statistics for all segment IDs
      for segmentIndex in range(visibleSegmentIds.GetNumberOfValues()):
        segmentID = visibleSegmentIds.GetValue(segmentIndex)
        self.updateStatisticsForSegment(segmentID)
function_tokens: def computeStatistics ( self ) : self . reset ( ) segmentationNode = slicer . mrmlScene . GetNodeByID ( self . getParameterNode ( ) . GetParameter ( "Segmentation" ) ) # Get segment ID list visibleSegmentIds = vtk . vtkStringArray ( ) if self . getParameterNode ( ) . GetParameter ( 'visibleSegmentsOnly' ) == 'True' : segmentationNode . GetDisplayNode ( ) . GetVisibleSegmentIDs ( visibleSegmentIds ) else : segmentationNode . GetSegmentation ( ) . GetSegmentIDs ( visibleSegmentIds ) if visibleSegmentIds . GetNumberOfValues ( ) == 0 : logging . debug ( "computeStatistics will not return any results: there are no visible segments" ) # update statistics for all segment IDs for segmentIndex in range ( visibleSegmentIds . GetNumberOfValues ( ) ) : segmentID = visibleSegmentIds . GetValue ( segmentIndex ) self . updateStatisticsForSegment ( segmentID )