Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaN appear in Padding, when using history #376

Closed
romainVala opened this issue Dec 10, 2020 · 0 comments 路 Fixed by #378
Closed

NaN appear in Padding, when using history #376

romainVala opened this issue Dec 10, 2020 · 0 comments 路 Fixed by #378
Labels
bug Something isn't working

Comments

@romainVala
Copy link
Contributor

馃悰Bug

Hi
a small one, but a funny one, related to how the internal change of the padding_mode (from int to string) is not clear enough ... for history !

To reproduce

# Your code here
import torchio as tio
s=tio.datasets.Colin27()
t=tio.CropOrPad(target_shape=[182,218,182] ,padding_mode =4)
st=t(s)
st_again=st.history[0](s)
print('what is the padding default? {} not {}'.format(st.t1.data[0,0,0,0],st_again.t1.data[0,0,0,0]))
# Your errors here
what is the padding default? 4.0 not nan
st.history
Out[6]: [Pad(padding=(1, 0, 1, 0, 1, 0), padding_mode=constant)]

Expected behavior

Actual behavior

TorchIO version

@romainVala romainVala added the bug Something isn't working label Dec 10, 2020
fepegar added a commit to romainVala/torchio that referenced this issue Dec 11, 2020
fepegar added a commit that referenced this issue Dec 11, 2020
* remove internal self.fill, and keep padding_mode as string or number

* Add test for #376

Co-authored-by: Fernando Perez-Garcia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant