code: def segment_radial_distances(neurites, neurite_type=NeuriteType.all, origin=None):
      '''Lengths of the segments in a collection of neurites'''
      def _seg_rd(sec, pos):
          '''list of radial distances of all segments of a section'''
          # TODO: remove this disable when pylint is fixed
          # pylint: disable=assignment-from-no-return
          mid_pts = np.divide(np.add(sec.points[:-1], sec.points[1:])[:, :3], 2.0)
          return np.sqrt([morphmath.point_dist2(p, pos) for p in mid_pts])
  
      dist = []
      for n in iter_neurites(neurites, filt=is_type(neurite_type)):
          pos = n.root_node.points[0] if origin is None else origin
          dist.extend([s for ss in n.iter_sections() for s in _seg_rd(ss, pos)])
  
      return disf segment_radial_distances(neurites, neurite_type=NeuriteType.all, origin=None):
      '''Lengths of the segments in a collection of neurites'''
      def _seg_rd(sec, pos):
          '''list of radial distances of all segments of a section'''
          # TODO: remove this disable when pylint is fixed
          # pylint: disable=assignment-from-no-return
          mid_pts = np.divide(np.add(sec.points[:-1], sec.points[1:])[:, :3], 2.0)
          return np.sqrt([morphmath.point_dist2(p, pos) for p in mid_pts])
  
      dist = []
      for n in iter_neurites(neurites, filt=is_type(neurite_type)):
          pos = n.root_node.points[0] if origin is None else origin
          dist.extend([s for ss in n.iter_sections() for s in _seg_rd(ss, pos)])
  
      return dist
docs: Lengths of the segments in a collection of neurites