-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hack for loading radiological volumes with uint8 data range
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andreped
Member
|
||
category = "MRI" | ||
else: | ||
category = "Annotation" | ||
return category | ||
|
@dbouget Where did you get
25
from? Typo? Did you mean255
?