MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

Make dictionary transforms support different random parameters across keys

Open surajpaib opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe. For current dictionary transforms, the random parameters are shared across keys.

E.g: see https://github.com/Project-MONAI/MONAI/blob/ec63e068fec85dff5f043d73f2c029b359332707/monai/transforms/intensity/dictionary.py#L1401

https://github.com/Project-MONAI/MONAI/blob/ec63e068fec85dff5f043d73f2c029b359332707/monai/transforms/croppad/dictionary.py#L405

Describe the solution you'd like An option to have separate random parameters would be useful for non input-target dictionary structure. Eg: for dicts that contain views in self-supervised learning. An additional key to the random dict transforms would be ideal

surajpaib avatar Mar 20 '24 10:03 surajpaib

Here is an example (the YAML config) of where it would be useful - we needed to duplicate transforms to apply them to different keys independently from each other ("view_0" and "view_1").

ibro45 avatar Mar 22 '24 15:03 ibro45

TorchIO implements random parameters on a per transform basis: TorchIO Transform ABC This would add this feature, however require a breaking change to the Randomizable and RandomTransform ABCs.

SomeUserName1 avatar Mar 28 '24 14:03 SomeUserName1