4d9d2a1fc4e0d9289000a235340235802d51a97a,app/grandchallenge/cases/image_builders/dicom.py,,_create_itk_from_dcm,#,262

Before Change


    shape = dcm_array.shape[::-1]
    // Write the numpy array to a file, so there is no need to keep it in memory
    // anymore. Then create a SimpleITK image from it.
    with tempfile.NamedTemporaryFile() as temp:
        temp.seek(0)
        temp.write(dcm_array.tobytes())
        temp.flush()
        temp.seek(0)

        del dcm_array

        img = SimpleITK.Image(shape, sitk_dtype, 1)
        SimpleITK._SimpleITK._SetImageFromArray(temp.read(), img)

    return img


def image_builder_dicom(

After Change


        np_dtype = np.float32
    else:
        np_dtype = np.short
    if samples_per_pixel > 1:
        pixel_dims += (samples_per_pixel,)
    dcm_array = None
    use_pixel_array = False

    for index, partial in enumerate(dicom_ds.headers):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: comic/grand-challenge.org
Commit Name: 4d9d2a1fc4e0d9289000a235340235802d51a97a
Time: 2021-02-12
Author: 57257130+MikeOverkamp-diag@users.noreply.github.com
File Name: app/grandchallenge/cases/image_builders/dicom.py
Class Name:
Method Name: _create_itk_from_dcm


Project Name: riga/tfdeploy
Commit Name: 2984beef3784e514a7b8512ab0e658ad01e86564
Time: 2016-03-11
Author: marcelrieger@me.com
File Name: setup.py
Class Name:
Method Name:


Project Name: GoogleCloudPlatform/ml-on-gcp
Commit Name: 8079adae33711e4886a625df3f0ae9860739f7b9
Time: 2019-09-03
Author: yuhanliu@google.com
File Name: example_zoo/tools/process.py
Class Name:
Method Name: