Skip to content

Commit a80f231

Browse files
CPBridgeMMelQin
andauthored
DICOM Seg Writer operater: Fix for case where input image is already a numpy array (#515)
* Fix for case where input image is already a numpy array Signed-off-by: Chris Bridge <chrisbridge44@googlemail.com> * Update example apps' test data path, patch hsdk in local env, and ensure correct MD SDK is used in dev env (#516) * Add post intall action to patch holoscan package, v2.7 and 2.8 Signed-off-by: M Q <mingmelvinq@nvidia.com> * Update fixed turorials Signed-off-by: M Q <mingmelvinq@nvidia.com> * Updated the setup post install action, local sdk version, and notebook examples Signed-off-by: M Q <mingmelvinq@nvidia.com> * Updated the doc too Signed-off-by: M Q <mingmelvinq@nvidia.com> * Fix linting error Signed-off-by: M Q <mingmelvinq@nvidia.com> --------- Signed-off-by: M Q <mingmelvinq@nvidia.com> --------- Signed-off-by: Chris Bridge <chrisbridge44@googlemail.com> Signed-off-by: M Q <mingmelvinq@nvidia.com> Co-authored-by: Ming M Qin <38891913+MMelQin@users.noreply.github.com>
1 parent 7de1e62 commit a80f231

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)