Skip to content
Discussion options

You must be logged in to vote

the default padding_mode doesn't work with the backend,
perhaps you can try one of these values 'grid-mirror', 'grid-constant', 'mirror', 'nearest', 'grid-wrap', 'constant', 'reflect', 'wrap':

>>> from monai.transforms import Spacingd
>>> import torch
>>> x = torch.zeros((4, 100, 100, 100))
>>> output = Spacingd(keys="image", pixdim=(2,2,2),  mode=3, padding_mode="nearest")({"image": x})
>>> output["image"].shape
(4, 50, 50, 50)
 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YerePhy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants