beaff02d91a80c2cf12e626d47b3f1678188472d,mne/source_space.py,,_get_volume_label_mask,#Any#Any#Any#,1852

Before Change


    vox_bool = mgz_data == vol_id

    // Get the 3 dimensional indices in voxel space
    vox_ijk = np.array(np.where(vox_bool)).T

    // Transform to MRI coordinates (where our surfaces live)
    _, vox_mri_t, _, _, _ = _read_mri_info(mri)
    rr_voi = apply_trans(vox_mri_t, vox_ijk)  // mri voxels -> MRI surface RAS
    // Filter out points too far from volume region voxels
    dists = _compute_nearest(rr_voi, rr, return_dists=True)[1]
    // Maximum distance from center of mass of a voxel to any of its corners
    maxdist = linalg.norm(vox_mri_t["trans"][:3, :3].sum(0) / 2.)
    return dists <= maxdist

After Change


    _, vox_mri_t, _, _, _ = _read_mri_info(mri)
    mri_vox_t = invert_transform(vox_mri_t)
    rr_vox = apply_trans(mri_vox_t, rr)
    good = (rr_vox >= -.5).all(-1)
    idx = np.empty(rr.shape[::-1], np.int64)
    for ii in range(3):
        good &= rr_vox[:, ii] < mgz_data.shape[ii] - 0.5
        idx[ii] = np.clip(np.round(rr_vox[:, ii]).astype(np.int64),
                          0, mgz_data.shape[ii] - 1)
    good &= mgz_data[tuple(idx)] == vol_id
    return good

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: mne-tools/mne-python
Commit Name: beaff02d91a80c2cf12e626d47b3f1678188472d
Time: 2020-04-22
Author: larson.eric.d@gmail.com
File Name: mne/source_space.py
Class Name:
Method Name: _get_volume_label_mask


Project Name: mne-tools/mne-python
Commit Name: beaff02d91a80c2cf12e626d47b3f1678188472d
Time: 2020-04-22
Author: larson.eric.d@gmail.com
File Name: mne/source_space.py
Class Name:
Method Name: _get_volume_label_mask


Project Name: dpressel/mead-baseline
Commit Name: 8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a
Time: 2020-03-09
Author: blester125@gmail.com
File Name: baseline/services.py
Class Name: ClassifierService
Method Name: predict


Project Name: has2k1/plotnine
Commit Name: d695f661f194ba222386ac4848ac259814de3e49
Time: 2014-04-29
Author: has2k1@gmail.com
File Name: ggplot/geoms/geom_abline.py
Class Name: geom_abline
Method Name: _plot_unit