-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add parameter unpacking for transforms #2437
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter unpacking for transforms #2437
Conversation
Signed-off-by: Sebastian Penhouet <sebastian.penhouet@airamed.de>
/integration-test |
mypy issues:
Strange that I did not get them on my local development. I will look into it. |
Hi @Spenhouet , Thanks for your quick PR, I think Thanks. |
/integration-test |
Signed-off-by: Sebastian Penhouet <sebastian.penhouet@airamed.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Btw. I did set the |
transformed_data = apply_transform(self.transform, data) | ||
|
||
if not isinstance(transformed_data, dict): | ||
raise AssertionError("With a dict supplied to apply_transform a single dict return is expected.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Spenhouet ,
Thanks very much for your quick PR!
I think this assert is not correct here, some MONAI sampling transforms return a list of dictionaries instead of a single dict.
I will submit a quick PR to fix it soon, CC @wyli @ericspod @rijobro .
Others of this PR look good to me.
Thanks.
Signed-off-by: Sebastian Penhouet sebastian.penhouet@airamed.de
Fixes #2426
Description
Transforms can return any number of values. This pull request enables that these return values are passed into the next transform in a Compose as parameters (unpacked arguments).
This is especially useful in the case where the input and output of transforms always matches like in the case of always passing along the image array and the meta data dict.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests
.make html
command in thedocs/
folder.