2923434b29a910232dfd6c3f5b5639216900592a,ants/utils/convert_nibabel.py,,to_nibabel,#,9

Before Change


            np.array(image.origin).reshape(3, 1),
        ]
    )
    affine = np.vstack([affine, np.array([0, 0, 0, 1.0])])
    affine[:2, :] *= -1
    new_img = nib.Nifti1Image(array_data, affine)
    return new_img

After Change


    import nibabel as nib
    tmpfile = mktemp(suffix=".nii.gz")
    image.to_filename(tmpfile)
    new_img = nib.load(tmpfile)
    // os.remove(tmpfile) //// Don"t remove tmpfile as nibabel lazy loads the data.
    return new_img

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ANTsX/ANTsPy
Commit Name: 2923434b29a910232dfd6c3f5b5639216900592a
Time: 2019-07-16
Author: d.gomez@posteo.org
File Name: ants/utils/convert_nibabel.py
Class Name:
Method Name: to_nibabel


Project Name: hanxiao/bert-as-service
Commit Name: 2bfe5bfcec7759ae022b1a479411aa7d1b8401f1
Time: 2019-05-06
Author: zyn2122@gmail.com
File Name: example/example7.py
Class Name:
Method Name:


Project Name: oarriaga/face_classification
Commit Name: afcd2b86b198a6e548ba43ac5cd135a9ccc86ec6
Time: 2017-07-04
Author: arriaga.camargo@gmail.com
File Name: src/utils/grad_cam.py
Class Name:
Method Name: