CropForeground behaviour #5842
-
I am croping my images to match a segmentation when I noticed my x-dimesnion isn't getting cropped somehow. I tested the CropForeground function: image = np.array( [[0, 1], Is this behaviour of CropForeground intended? Shouldn't it get cropped to [[0, 1], Thanks for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @schellenchris, since transforms in MONAI assume that the data is channel-first, so you need to add the channel dimension to the data before passing it into the transforms. Could you please try Hope it can help you, thanks! |
Beta Was this translation helpful? Give feedback.
Hi @schellenchris, since transforms in MONAI assume that the data is channel-first, so you need to add the channel dimension to the data before passing it into the transforms. Could you please try
print(cropper(image[None]))
?Hope it can help you, thanks!