Skip to content

Commit 668e24f

Browse files
committed
Fix for case where input image is already a numpy array
1 parent 9608cd7 commit 668e24f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

monai/deploy/operators/dicom_seg_writer_operator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ def process_images(
288288
seg_image_numpy = image.asnumpy()
289289
elif isinstance(image, (Path, str)):
290290
seg_image_numpy = self._image_file_to_numpy(str(image))
291-
elif not isinstance(image, np.ndarray):
292-
raise ValueError("'image' is not a numpy array, Image object, or supported image file.")
291+
else:
292+
if not isinstance(image, np.ndarray):
293+
raise ValueError("'image' is not a numpy array, Image object, or supported image file.")
294+
seg_image_numpy = image
293295

294296
# Pick DICOM Series that was used as input for getting the seg image.
295297
# For now, first one in the list.

0 commit comments

Comments
 (0)