diff --git a/utils/utilities.py b/utils/utilities.py index 199958b..8b76523 100644 --- a/utils/utilities.py +++ b/utils/utilities.py @@ -47,10 +47,12 @@ def input_file_category_disambiguation(input_filename: str) -> str: image_type = image.GetPixelIDTypeAsString() array = sitk.GetArrayFromImage(image) - # @TODO. Have encountered FLAIR images with integer values in [0, 255], from DICOM conversion, which will be - # failed associated as annotations... if len(np.unique(array)) > 255 or np.max(array) > 255 or np.min(array) < -1: category = "MRI" + # If the input radiological volume has values within [0, 255] only. Empirical solution for now, since less than + # 10 classes are usually handle at any given time. + elif len(np.unique(array)) >= 25: + category = "MRI" else: category = "Annotation" return category