Skip to content

Commit 2f70b9d

Browse files
committed
DICOM image regularization added
1 parent 605ad3b commit 2f70b9d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

superannotate/dicom_converter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def dicom_to_rgb_sequence(
3535
else:
3636
number_of_frames = 1
3737
arr = arr[np.newaxis, :]
38+
if arr.dtype != np.uint8:
39+
arr = (arr - arr.min()) / arr.max() * 255
40+
arr = arr.astype(np.uint8)
3841
output_dir = Path(output_dir)
3942
output_paths = []
4043
for i in range(number_of_frames):

0 commit comments

Comments
 (0)