text_html_output_1.png
import cv2

import numpy as np

import pydicom

def load_dicom(path):
    dicom = pydicom.read_file(path)
    data = dicom.pixel_array
    data = data - np.min(data)
    if np.max(data) != 0:
        data = data / np.max(data)
    data = (data * 255).astype(np.uint8)
    return data

path0 = '../input/rsna-miccai-brain-tumor-radiogenomic-classification/train/00000/T1wCE/Image-1.dcm'
img1 = load_dicom(path0)
img2 = cv2.resize(img1, (9, 9))
print(img1.shape)
print(img2.shape)