475722f1825d7c54fd27fb42723874ecc30b8f5d,cellprofiler/modules/reassignobjectnumbers.py,,copy_labels,#Any#Any#,495

Before Change


    max_labels = np.max(labels)
    labels_new = segmented+max_labels
    labels_new[segmented==0] = labels[segmented==0]
    unique_labels = np.unique(labels_new)
    new_indexes = np.zeros(np.max(unique_labels)+1,int)
    new_indexes[unique_labels] = np.arange(len(unique_labels))+1
    labels_new = new_indexes[labels_new]
    return labels_new

After Change


    segmented - the newly numbered labels matrix (a subset of pixels are labeled)
    """
    max_labels = np.max(segmented)
    seglabel = scind.minimum(labels, segmented, np.arange(1, max_labels+1))
    labels_new = labels.copy()
    labels_new[segmented != 0] = seglabel[segmented[segmented != 0] - 1]
    return labels_new
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: 475722f1825d7c54fd27fb42723874ecc30b8f5d
Time: 2011-02-02
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/modules/reassignobjectnumbers.py
Class Name:
Method Name: copy_labels


Project Name: chainer/chainercv
Commit Name: 2d44d66f74c0be1f2952af80cc11a9076fd71e3c
Time: 2019-03-04
Author: yuyuniitani@gmail.com
File Name: chainercv/links/model/mask_rcnn/mask_head.py
Class Name:
Method Name: mask_loss_post


Project Name: ScottfreeLLC/AlphaPy
Commit Name: 7a7d0e7b35cbee6b3409ac30ff4bf4edfe525af2
Time: 2019-11-17
Author: Mark.R.Conway@gmail.com
File Name: alphapy/plots.py
Class Name:
Method Name: plot_confusion_matrix


Project Name: bethgelab/foolbox
Commit Name: bfd3231bbe8cb3f983167a61cfb607445f951b3c
Time: 2018-08-17
Author: rusak@fzi.de
File Name: foolbox/attacks/adef_attack.py
Class Name: ADefAttack
Method Name: __call__