From 0ed4dab796361a3dc6409e617b0847fa89c3660d Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Tue, 26 Dec 2023 13:37:15 -0700 Subject: [PATCH] Fix num_files when merging --- mdai_utils/download_annotations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mdai_utils/download_annotations.py b/mdai_utils/download_annotations.py index 9973ac5..2f61709 100644 --- a/mdai_utils/download_annotations.py +++ b/mdai_utils/download_annotations.py @@ -207,7 +207,9 @@ def get_dicom_names_ordered_and_metadata(dicom_dir): series_uids = io.GetSeriesUIDs() error_msg += f"\nFound more than one series with more than 20 files each {num_files}. Reading the series without date distinction, merging into one series." selected_index = 0 - num_files = [io.GetFileNames(s) for s in series_uids] + files = io.GetFileNames(series_uids[0]) + num_files = [len(files)] + sops_per_series = [Path(f).stem for f in files] error_msg += ( f"\nSelected series {selected_index} with {num_files[selected_index]} files"