From ae3dc272ae5e37182328d4fc5ae57e75b68561c0 Mon Sep 17 00:00:00 2001 From: Gianluca Rossi Date: Fri, 5 Apr 2024 15:01:34 -0400 Subject: [PATCH] chore: use dcmread instead of deprecated read_file --- blazingai/vision/convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blazingai/vision/convert.py b/blazingai/vision/convert.py index 71ff972..060b258 100644 --- a/blazingai/vision/convert.py +++ b/blazingai/vision/convert.py @@ -5,7 +5,7 @@ from joblib import Parallel, delayed from loguru import logger from PIL import Image -from pydicom import filereader +from pydicom import dcmread from pydicom.pixel_data_handlers.util import apply_voi_lut from tqdm import tqdm @@ -65,7 +65,7 @@ def convert_dicom2numpy( ) -> np.ndarray | ValueError: # credits: https://www.kaggle.com/raddar/convert-dicom-to-np-array-the-correct-way try: - dicom = filereader.read_file(img_path) + dicom = dcmread(img_path) except ValueError as e: return e