Skip to content
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

Augmentation Transform | InCut & OutCut Dropping (ETA 08/27/21) #2707

Closed
finalelement opened this issue Aug 6, 2021 · 6 comments · Fixed by #2837 or #2848
Closed

Augmentation Transform | InCut & OutCut Dropping (ETA 08/27/21) #2707

finalelement opened this issue Aug 6, 2021 · 6 comments · Fixed by #2837 or #2848

Comments

@finalelement
Copy link
Collaborator

Dropping off randomly sized patches from inside the image and out the image where apart from them everything else gets dropped out.

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 6, 2021

Hi @finalelement ,

Thanks for the feature request, is it similar to this existing transform in MONAI: RandCoarseDropout ?
https://github.com/Project-MONAI/MONAI/blob/dev/monai/transforms/intensity/array.py#L1566

Thanks.

@finalelement
Copy link
Collaborator Author

Hi @Nic-Ma At the first sight, it does seem similar. This is quite similar to drop 'in' the image. However this does not support dropping off the rest of the image and just leaving the hole. This would be termed as out Out Cut.

Thanks for the pointer, Ill use this as reference and will also do some empirical testing on a couple of images.

@finalelement
Copy link
Collaborator Author

Hey @Nic-Ma I read and compared the code for In-cutout with the transform that you suggested me to look into RandCoarseDropout. There is only one difference that I see between the one available with MONAI and the one that I've been using. It is essentially allowing for the flexibility of filling the 'hole' with random values between 0 and 1 rather than a specified value.

Doing this would be more useful. Perhaps we could give the user an option to either specify the fill value, if it is not specified we could fill it in with torch.rand. Specifically by introducing an if condition at ~Line 1632 in this file

@finalelement finalelement changed the title Augmentation Transform | InCut & OutCut Dropping Augmentation Transform | InCut & OutCut Dropping (ETA 08/27/21) Aug 20, 2021
@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 20, 2021

Hi @finalelement ,

I think you can add a mode arg in the RandCoarseDropout transform, mode can be "constant" or "random", similar to the numpy pad modes.

Thanks.

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 20, 2021

CC @wyli @ericspod

@Nic-Ma Nic-Ma self-assigned this Aug 23, 2021
@Nic-Ma
Copy link
Contributor

Nic-Ma commented Aug 23, 2021

According to the online discussion, I will try to enhance the existing RandCoarseDropout transform to support random filling ASAP.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment