def get_objects_zsize(L):
    """Retrieve objects size (2/3D).

    Args:
      L (np.array): labelled thresholded image.

    Returns:
      list: Z size of every object in the labelled image.
    """

    return [(L == i).astype("int").sum(0).max() for i in range(1, L.max())]