fepegar / torchio

Medical imaging toolkit for deep learning
https://torchio.org
Apache License 2.0
2.08k stars 240 forks source link

Resample #1102

Closed cerenov94 closed 1 year ago

cerenov94 commented 1 year ago

Is there an existing issue for this?

Problem summary

Hi there! after using Resample i have tensor with full of zeros. That would be great if someone help me to overcome this issue. sorry for disturbing.

Code for reproduction

small_image = tio.ScalarImage('image_path')
# image shape =  (1,343,343,467), spacing (1.20,1.20,1.20),orientetion RAS+
resample = tio.Resample(small_image)
big_image = tio.ScalarImage('image_path')
# big image shape = (1,512,512,1022),spacing (0.89,0.89,0.50),orientetion RAS+
image_resampled = resample(big_image)
## output image after resample with the shape thats i need but tensor full of zeros

Actual outcome

tensor of zeros

Error messages

no error

Expected outcome

expect correct values in output tensor

System info

Platform:   Linux-6.2.0-26-generic-x86_64-with-glibc2.35
TorchIO:    0.19.1
PyTorch:    2.0.1
SimpleITK:  2.2.1 (ITK 5.3)
NumPy:      1.24.3
Python:     3.10.11 | packaged by conda-forge | (main, May 10 2023, 18:58:44) [GCC 11.3.0]