c8b28432a637a780eed96547260722ff3dede57e,niftynet/engine/sampler_selective.py,,create_label_size_map,#Any#Any#,140

Before Change


    """
    data = np.round(data)
    labels = np.unique(data)
    print("Labels are ", labels)
    binary_seg = np.copy(data)
    binary_seg = np.where(binary_seg == value, np.ones_like(data),
                          np.zeros_like(data))
    labelled_data, num_features = ndimage.label(binary_seg)

After Change


    unique, count = np.unique(labelled_data, return_counts=True)
    count_data = np.copy(labelled_data)
    for label, size in zip(unique, count):
        if label == 0:
            continue
        count_data = np.where(labelled_data == label,
                              np.ones_like(data) * size,
                              count_data)
    return count_data
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: NifTK/NiftyNet
Commit Name: c8b28432a637a780eed96547260722ff3dede57e
Time: 2017-10-04
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/sampler_selective.py
Class Name:
Method Name: create_label_size_map


Project Name: deepinsight/insightface
Commit Name: b822dd34ae4b19e92af3067c7356dfabfe706b59
Time: 2018-04-09
Author: guojia@gmail.com
File Name: src/data/age_merge.py
Class Name:
Method Name: main


Project Name: deepinsight/insightface
Commit Name: ea03542ab136a27fd4188e9f2d44efd763beffec
Time: 2018-04-09
Author: guojia@gmail.com
File Name: src/data/age_merge.py
Class Name:
Method Name: main


Project Name: KaiyangZhou/deep-person-reid
Commit Name: af41e231a6d1991ed7ab8197effdd098a9fb3de8
Time: 2018-05-02
Author: k.zhou@qmul.ac.uk
File Name: data_manager.py
Class Name: DukeMTMCVidReID
Method Name: _process_dir