Exemple #1
0
def slow_labeled_min(array, labeled):
    return np.array(
        [np.min(array * (labeled == i)) for i in range(labeled.max() + 1)])
Exemple #2
0
def slow_labeled_size(labeled):
    return np.array([np.sum(labeled == i) for i in range(labeled.max() + 1)])
Exemple #3
0
def slow_labeled_size(labeled):
    return np.array([
            np.sum(labeled == i)
            for i in range(labeled.max()+1)
        ])
Exemple #4
0
def slow_labeled_min(array, labeled):
    return np.array([
            np.min(array * (labeled == i))
            for i in range(labeled.max()+1)
        ])
Exemple #5
0
def slow_labeled_sum(array, labeled):
    return np.array(
        [np.sum(array * (labeled == i)) for i in xrange(labeled.max() + 1)])
Exemple #6
0
def slow_labeled_sum(array, labeled):
    return np.array([
            np.sum(array * (labeled == i))
            for i in xrange(labeled.max()+1)
        ])