Add parameter unpacking for transforms#2437
Merged
wyli merged 4 commits intoProject-MONAI:devfrom Jun 24, 2021
Merged
Conversation
Signed-off-by: Sebastian Penhouet <[email protected]>
Contributor
|
/integration-test |
Contributor
Author
|
mypy issues: Strange that I did not get them on my local development. I will look into it. |
Contributor
|
Hi @Spenhouet , Thanks for your quick PR, I think Thanks. |
Contributor
|
/integration-test |
Signed-off-by: Sebastian Penhouet <[email protected]>
Contributor
Author
Contributor
Author
|
Btw. I did set the |
Nic-Ma
reviewed
Jun 24, 2021
| 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.") |
Contributor
There was a problem hiding this comment.
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.
7 tasks
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sebastian Penhouet [email protected]
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 htmlcommand in thedocs/folder.