DCM to JPG
import glob import pydicom as pyd import cv2 import numpy as np from tqdm import tqdm dcm_list = glob.glob('Data_path/*.dcm') def dcm_to_array(file): if 'MONOCHROME1' in file.PhotometricInterpretation: img = np.invert(file.pixel_array) else: img = np.asarray(file.pixel_array) return img.astype(float) def img_min_max_norm(image): min = image.min() max = image.max() image = (image - min) / (max - ..
2021.09.24