|
22 | 22 | from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
23 | 23 |
|
24 | 24 | import numpy as np
|
25 |
| - |
26 | 25 | import SimpleITK
|
27 | 26 | from SimpleITK import Image as SimpleITKImage
|
| 27 | + |
28 | 28 | from monai.deploy.core import AppContext, Fragment, Image, IOType, OperatorSpec
|
29 | 29 | from monai.deploy.utils.importutil import optional_import
|
30 | 30 |
|
@@ -705,16 +705,6 @@ def _receive_input(self, name: str, op_input, context):
|
705 | 705 | logging.debug(f"Metadata of the converted input image: {metadata}")
|
706 | 706 | elif isinstance(value, np.ndarray):
|
707 | 707 | value = torch.from_numpy(value).to(self._device)
|
708 |
| - elif isinstance(value, SimpleITKImage): |
709 |
| - metadata = {} |
710 |
| - metadata["pixdim"] = np.asarray(value.GetSpacing()) |
711 |
| - metadata["origin"] = np.asarray(value.GetOrigin()) |
712 |
| - metadata["direction"] = np.asarray(value.GetDirection()) |
713 |
| - if len(value.GetSize()) == 3: |
714 |
| - metadata["pixdim"] = np.insert(np.asarray(value.GetSpacing()), 0, 1.0) |
715 |
| - value = np.transpose(SimpleITK.GetArrayFromImage(value), [2, 1, 0]) |
716 |
| - else: |
717 |
| - value = np.transpose(SimpleITK.GetArrayFromImage(value), [0, 3, 2, 1]) |
718 | 708 |
|
719 | 709 | # else value is some other object from memory
|
720 | 710 |
|
|
0 commit comments