Skip to content

Commit

Permalink
Fix for case where input image is already a numpy array
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Bridge <[email protected]>
  • Loading branch information
CPBridge committed Jan 15, 2025
1 parent 9608cd7 commit 14fb7aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions monai/deploy/operators/dicom_seg_writer_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,10 @@ def process_images(
seg_image_numpy = image.asnumpy()
elif isinstance(image, (Path, str)):
seg_image_numpy = self._image_file_to_numpy(str(image))
elif not isinstance(image, np.ndarray):
raise ValueError("'image' is not a numpy array, Image object, or supported image file.")
else:
if not isinstance(image, np.ndarray):
raise ValueError("'image' is not a numpy array, Image object, or supported image file.")
seg_image_numpy = image

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

0 comments on commit 14fb7aa

Please sign in to comment.