Closed KonoMaxi closed 10 months ago
Thanks for reporting and adding the tests, @KonoMaxi. I've added a fix and merged your PR. These errors shouldn't happen in v0.19.4.
@all-contributors please add @KonoMaxi for bug
@fepegar
I've put up a pull request to add @KonoMaxi! :tada:
Glad I could help and thank you for fixing this bug. Looking forward to using metadata in my SubjectsDataset again :-)
Is there an existing issue for this?
Bug summary
Hello Fernando, I discovered a little bug last week.
The documentation suggests adding metadata to my subjects, like a name and an age https://torchio.readthedocs.io/data/subject.html And it works nicely!
But when I reworked my transformations, I noticed, that
get_subjects_from_batch
has problems with metadata. It seems to discard it entirely. In addition int-values (like age) even causeget_subjects_from_batch
to crash!I don't know if I'm using
SubjectsDataset.from_batch
wrong, but at first sight this looks like a bug to me. I'll add a PR with two failing test-cases.As I'm unsure what the intended behavior is, I'll wait for your feedback before I take a deeper look at the code myself.
Regards, Max
Code for reproduction
Actual outcome
AssertionError on test_subjects_from_batch_with_string_metadata RuntimeError on test_subjects_from_batch_with_int_metadata
Error messages
Expected outcome
The original subject from the first line of each test
System info