SpatialPad, ResizeWithPadOrCrop fails in simple example #6304
-
Describe the bug
To Reproduce
Expected behavior Screenshots Environment Ensuring you use the relevant python executable, please paste the output of:
================================
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @juanprietob, Since most of the transforms in MONAI assume that the shape of the data is BxCxHxWx[D], you should add channel dim using Hope it can help you, thanks! |
Beta Was this translation helpful? Give feedback.
Hi @juanprietob, Since most of the transforms in MONAI assume that the shape of the data is BxCxHxWx[D], you should add channel dim using
EnsureChannelFirst
.Try something like:
image = np.random.randint(0, 256, (50, 50, 50), dtype=np.uint8)[None]
.Hope it can help you, thanks!