Skip to content

Commit 2486681

Browse files
committed
PY39: Support pre-__or__ types
1 parent 5aa2473 commit 2486681

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nitransforms/resampling.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from os import cpu_count
1313
from functools import partial
1414
from pathlib import Path
15-
from typing import Callable, TypeVar
15+
from typing import Callable, TypeVar, Union
1616

1717
import numpy as np
1818
from nibabel.loadsave import load as _nbload
@@ -144,8 +144,8 @@ async def _apply_serial(
144144

145145
def apply(
146146
transform: TransformBase,
147-
spatialimage: str | Path | SpatialImage,
148-
reference: str | Path | SpatialImage = None,
147+
spatialimage: Union[str, Path, SpatialImage],
148+
reference: Union[str, Path, SpatialImage] = None,
149149
order: int = 3,
150150
mode: str = "constant",
151151
cval: float = 0.0,
@@ -154,7 +154,7 @@ def apply(
154154
dtype_width: int = 8,
155155
serialize_nvols: int = SERIALIZE_VOLUME_WINDOW_WIDTH,
156156
max_concurrent: int = min(cpu_count(), 12),
157-
) -> SpatialImage | np.ndarray:
157+
) -> Union[SpatialImage, np.ndarray]:
158158
"""
159159
Apply a transformation to an image, resampling on the reference spatial object.
160160

0 commit comments

Comments
 (0)