-
Notifications
You must be signed in to change notification settings - Fork 17
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
Elastic 3d #79
Elastic 3d #79
Conversation
Cool! I will take a closer look tomorrow :). |
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.
I had a look at this now and the changes and results of the augmentation look good!
I would just suggest to change the name, since it's not a real 3d elastic augmentation (in the sense of applying a 3d warp field).
I went ahead and pushed a few more changes to reactivate the normal 2d augmentation as well.
(I also realized that we will need tests for this; bit since there aren't any yet let's go ahead with this PR as it is and we can then add tests later.)
torch_em/transform/augmentation.py
Outdated
@@ -6,7 +6,67 @@ | |||
from ..util import ensure_tensor | |||
|
|||
|
|||
# TODO RandomElastic3D ? | |||
class RandomElasticDeformation3D(kornia.augmentation.AugmentationBase3D): |
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.
The name is a bit misleading. I would assume that RandomElasticDeformation3D
applies real 3d deformations. Maybe rename to RandomElasticDeformationStacked
.
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.
I went ahead and renamed it.
Add 3D elastic deformation by applying the same x-y deformation field to each z slice.
![elastic3D_borders](https://user-images.githubusercontent.com/89460016/180633014-48a99866-cae3-439a-bc3c-79c7491a563f.png)
padding_mode="reflection"
to avoid strange border effects like here:The same deformation is applied to each sample in batch.