How to apply same transform to image and label using 'Dataset'? #1788
-
Hi, I am a newbie for using monai and PyTorch. I am trying to reconstruct an image by a paired pixel-wise supervised learning and a simple U-net. I have transformed and loaded the image and label image (or we can say it as the groundtruth image) in this way:
When I plot the "image" and "label" in the
Thank you very much for your kind help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
You're applying For any transforms that will require interpolation, you'll want to use nearest neighbour interpolation with your label. So you would use a list of different interpolations for the different keys, e.g., |
Beta Was this translation helpful? Give feedback.
-
Sorry we have found my problem in plotting the images. I have used
In the above I apply transform in the
Then the Thanks a lot! :) |
Beta Was this translation helpful? Give feedback.
Sorry we have found my problem in plotting the images. I have used
In the above I apply transform in the
train_files
each time when I plottrain_ds
separately. Instead, I should plot in this way: