You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I put an integer (0-5) for the mode for SpatialResample to perform spline interpolation, I get an error. The error seems to involve the padding method being set to 'border' which I never specified. The error goes away if I switch the interpolation mode to "bilinear" or "nearest".
To Reproduce
from monai.data import MetaTensor
import torch
from monai.transforms import SpatialResample
image = MetaTensor(x=torch.rand((1, 100, 100, 100)), affine=torch.diag(torch.ones(4)))
SpatialResample(mode=3)(img=image, dst_affine=image.affine, spatial_size=image.shape)
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3460, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-8-203f9d215858>", line 1, in <module>
SpatialResample(mode=3)(img=image, dst_affine=image.affine, spatial_size=image.shape)
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/monai/utils/deprecate_utils.py", line 221, in _wrapper
return func(*args, **kwargs)
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/monai/transforms/spatial/array.py", line 306, in __call__
img = affine_xform(img, mode=mode, padding_mode=padding_mode)
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/monai/transforms/spatial/array.py", line 2290, in __call__
out = self.resampler(img, grid=grid, mode=_mode, padding_mode=_padding_mode)
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/monai/transforms/spatial/array.py", line 2134, in __call__
[
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/monai/transforms/spatial/array.py", line 2135, in <listcomp>
_map_coord(c, grid_np, order=int(_interp_mode), mode=look_up_option(_padding_mode, NdimageMode))
File "/Users/david.ellis/miniconda3/envs/unet/lib/python3.10/site-packages/monai/utils/module.py", line 133, in look_up_option
raise ValueError(f"Unsupported option '{opt_str}', " + supported_msg)
ValueError: Unsupported option 'border', Available options are {'mirror', 'reflect', 'grid-constant', 'grid-wrap', 'grid-mirror', 'wrap', 'constant', 'nearest'}.
Expected behavior
Not raising an error when I specify spline interpolation.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I put an integer (0-5) for the mode for SpatialResample to perform spline interpolation, I get an error. The error seems to involve the padding method being set to 'border' which I never specified. The error goes away if I switch the interpolation mode to "bilinear" or "nearest".
To Reproduce
Expected behavior
Not raising an error when I specify spline interpolation.
The text was updated successfully, but these errors were encountered: