Skip to content

Commit 8bfc852

Browse files
Remove SimpleITK image handling from MonaiBundleInferenceOperator
Signed-off-by: Simone Bendazzoli <simben@kth.se>
1 parent d035ab3 commit 8bfc852

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

monai/deploy/operators/monai_bundle_inference_operator.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -707,16 +707,6 @@ def _receive_input(self, name: str, op_input, context):
707707
logging.debug(f"Metadata of the converted input image: {metadata}")
708708
elif isinstance(value, np.ndarray):
709709
value = torch.from_numpy(value).to(self._device)
710-
elif isinstance(value, SimpleITKImage):
711-
metadata = {}
712-
metadata["pixdim"] = np.asarray(value.GetSpacing())
713-
metadata["origin"] = np.asarray(value.GetOrigin())
714-
metadata["direction"] = np.asarray(value.GetDirection())
715-
if len(value.GetSize()) == 3:
716-
metadata["pixdim"] = np.insert(np.asarray(value.GetSpacing()), 0, 1.0)
717-
value = np.transpose(SimpleITK.GetArrayFromImage(value), [2, 1, 0])
718-
else:
719-
value = np.transpose(SimpleITK.GetArrayFromImage(value), [0, 3, 2, 1])
720710

721711
# else value is some other object from memory
722712

0 commit comments

Comments
 (0)