-
Notifications
You must be signed in to change notification settings - Fork 240
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
RandomAffine and RandomElasticDeformation on differently sized and oriented images #734
Comments
Hi, @Spenhouet. I think I understand the problem. It makes sense. Maybe we can add a flag to those transforms to not check for spatial consistency, as long as users know what they're doing. Also, we might need to be careful with the center of rotation as the image center is used by default at the moment. Anyway, could you please share one image and the corresponding label? |
Just to make sure we are on the same page: The transforms would still need to be spatially consistent in the sense, that the transforms would need to be applied the same for image + labels. Here the example image + labels: |
This can be trivially solved for |
@fepegar I'm happy with what ever you have time for 👍 I can split it of into a separate feature request? |
Ok, I'll open the PR and ping you.
I think we don't need to. However, I really won't be able to tackle the elastic one. Contributions are of course welcome! |
Thanks! I might give the ElasticDeformation a short look but my time is currently also very limited. |
Good luck! The docs should help understand how the deformation field is generated and how it's applied.
I think it's fine to keep it open. |
Patch for |
Hi |
@romainVala After the data augmentations (and some other operations) we perform a crop on the T1 (and respectively on the labels) based on the bounding box of the labels. We then also upscale the T1 and merge all labels (which still have different box sizes and affines). So in the end we have a small FoV for the image and the labels with matching shapes. But the augmentations are performed globally. Performing the augmentations only on the FoV would give unrealistic results. Example output (augmented): |
interesting way to spare space with multiple label file covering only a subpart of the total FOV ... Taking your approach a making transform is difficult to handle this imply to get the deformation field, at the low resolution and interpolated it at the high resolution and then crop it to the exact FOV of the specific label at hand ... or do you see other workaround ? (just for curiosity of what changes should be made) |
It probably is necessary to perform the crop first and then perform the interpolation. Else you are going to get into the out of RAM territory. |
🚀 Feature
We have a full size image and then small FoV labels with a higher resolution.
Sadly the
RandomAffine
andRandomElasticDeformation
augmentations do not run for this due to the size difference.We can not upscale the labels since this would not fit the RAM.
We have to perform all augmentations on the individually sized images.
Motivation
For us this would be very helpful. We are mostly working with MONAI but frankly, the augmentations of torch.io are just better.
The respective MONAI augmentations also do not support this.
They do not throw an error like torch.io does (which in this case is better) but they output images which longer fit in terms of their affine (and probably also not in terms of the augmentation).
Would you need example files for that? Is this something to consider?
The text was updated successfully, but these errors were encountered: