def getSelectionShape(selection):
    """ Return the shape of the given selection.
      Examples (selection -> returned shape):
      [(3,7,1)] -> [4]
      [(3, 7, 3)] -> [1]
      [(44, 52, 1), (48,52,1)] -> [8, 4]
    """
    shape = []
    rank = len(selection)
    for i in range(rank):
        s = selection[i]
        extent = 0
        if s.stop > s.start:
            extent = s.stop - s.start
        if s.step > 1 and extent > 0:
            extent = (extent // s.step)
        if (s.stop - s.start) % s.step != 0:
            extent += 1
        shape.append(extent)
    return shape