Replies: 1 comment 7 replies
-
Hi, @ik362. I'm not sure what the problem is. import torch
import torchio as tio
fmri = tio.ScalarImage(tensor=torch.rand(35, 128, 128, 92))
transform = tio.CropOrPad((88, 88, 88))
transformed = transform(fmri) Can you tell us a bit more about your data and your application? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I am using torchio+pytorch-lightning to do some image classification. The tricky part is that I use 4D fMRI data; so far this has not been a problem except that not all my data is the same shape.
I wanted to ask then: is there a way that I can use CropOrPad on 4D data (looking at the docs for CropOrPad looks to only work in 3D)?
If CropOrPad cannot be applied to 4D data is there another workaround?
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions