897565a0174f93d750b22bb846bd0f4c16e76a01,nilearn/regions/region_extractor.py,,extract_regions_labels_img,#Any#Any#Any#,443

Before Change


    current_max_label = 0
    for label_id in unique_labels:
        this_label_mask = (labels_data == label_id)
        if not np.any(this_label_mask):
            continue
        // Extract regions assigned to each label id
        regions, this_n_labels = _compute_regions_labels(
            this_label_mask.astype(np.int), connect_diag=connect_diag)
        regions = regions.copy()

        if min_size is not None:
            index = np.arange(this_n_labels + 1)
            this_label_mask = this_label_mask.astype(np.int)

After Change


            this_label_mask = this_label_mask.astype(np.int)
            regions = _remove_small_regions(regions, this_label_mask,
                                            index, min_size=min_size)
            this_n_labels = regions.max()

        new_labels_data[regions != 0] = (regions[regions != 0]
                                         + current_max_label)
        current_max_label += this_n_labels
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: nilearn/nilearn
Commit Name: 897565a0174f93d750b22bb846bd0f4c16e76a01
Time: 2017-02-13
Author: gael.varoquaux@normalesup.org
File Name: nilearn/regions/region_extractor.py
Class Name:
Method Name: extract_regions_labels_img


Project Name: nilearn/nilearn
Commit Name: 5e3cd5a9f1dfc0e320d3ff5a384505bf06904365
Time: 2014-12-04
Author: loic.esteve@ymail.com
File Name: nilearn/plotting/displays.py
Class Name: BaseSlicer
Method Name: _map_show


Project Name: scikit-image/scikit-image
Commit Name: f1e415f5719f9175e3dd59b447de17ef0c40fe76
Time: 2016-10-20
Author: metz.jp@gmail.com
File Name: skimage/feature/peak.py
Class Name:
Method Name: peak_local_max


Project Name: facebookresearch/ParlAI
Commit Name: 72e28f315e6458993407beb4d7041ccebca90735
Time: 2018-10-16
Author: bhancock@fb.com
File Name: parlai/core/torch_ranker_agent.py
Class Name: TorchRankerAgent
Method Name: _build_candidates