-
Notifications
You must be signed in to change notification settings - Fork 1.3k
4769 adds a util to reset applied operations id #4778
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
Conversation
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
|
/build |
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.
Looks good.. useful for monailabel as well.. it needs to cache image MetaTensor and to resuse in the pipeline it needs to reset the ids to run invert post tranforms
|
Hi @wyli @SachidanandAlle @rijobro @KumoLiu , Instead of permanently reseting the op ids in the
def pop_transform(self, data, key: Hashable = None, check: bool = get_id_check())https://github.com/Project-MONAI/MONAI/blob/dev/monai/transforms/inverse.py#L191 The benefit is that:
What do you guys think? Thanks. |
|
Hi @Nic-Ma in my understanding when we store the applied operations info in a persistent cache, the id info becomes invalid because the cache is supposed to be loaded in other runs. In this case resetting the ids would be good. I'd be reluctant to change the pop_transform API unless we see a good use case for it. Note for some transforms there's also an 'inverse_transform' method to 'bypass' the check MONAI/monai/transforms/spatial/array.py Line 890 in 46d9026
|
|
Hi @wyli , I think users usually use persistent dataset for 2 reasons: For (1) you are right, the info becomes invalid, for (2) the applied transforms are still the original instances. Thanks. |
|
I think setting the data id would have finer control of the check. There's nothing wrong with your global flag, it might be useful in the future to completely turn off the check, but it's not needed at the moment. I think we should avoid global flags whenever possible. |
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
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 for the quick update.
Looks good to me now.
|
/build |
Signed-off-by: Wenqi Li wenqil@nvidia.com
Fixes #4769
Description
reset_ops_idto reset the id of the applied operationcc @SachidanandAlle
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.