MONAI
MONAI copied to clipboard
Make dictionary transforms support different random parameters across keys
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
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"
).
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.