def load_contour(contour, img_path):
    filename = 'IM-%s-%04d.dcm' % (sax_series_dict[contour.case], contour.img_no)
    full_path = os.path.join(img_path, contour.case, filename)
    f = dicom.read_file(full_path)
    img = f.pixel_array.astype(np.uint8)
    ctrs = np.loadtxt(contour.ctr_path, delimiter=' ').astype(np.int)
    label = np.zeros_like(img, dtype='uint8')
    cv2.fillPoly(label, [ctrs], 1)
    return cv2.resize(img, (img_size,img_size)), cv2.resize(label, (img_size,img_size))
dataset/ETHPy150Open woshialex/diagnose-heart/CNN_B/sunnybrook.py/load_contour/original