4769 adds a util to reset applied operations id#4778
Conversation
Signed-off-by: Wenqi Li <[email protected]>
|
/build |
SachidanandAlle
left a comment
There was a problem hiding this comment.
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())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 <[email protected]>
|
/build |
Signed-off-by: Wenqi Li [email protected]
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.