Spaces:
Sleeping
Sleeping
import streamlit as st | |
import pydicom | |
import cv2 | |
import numpy as np | |
def convert_dcm_to_png(input_image_path, output_image_path='a.png'): | |
ds = pydicom.dcmread(input_image_path) | |
img = ds.pixel_array | |
img = cv2.normalize(img, None, 0, 255, cv2.NORM_MINMAX).astype(np.uint8) | |
cv2.imwrite(output_image_path, img) |