RandCropByPosNegLabel: Random location #2115
Replies: 8 comments
-
Hi @lukasfolle , Thanks for raising this up. Thanks. |
Beta Was this translation helpful? Give feedback.
-
i think this could be achieved by providing a dilated version of the original foreground as the sampling candidate locations (label_key). it’s slightly different from #586 |
Beta Was this translation helpful? Give feedback.
-
@wyli Could you elaborate on "dilated version of the original foreground as the sampling candidate locations"? I had the following in mind:
Please let me know what you think of this proposal. |
Beta Was this translation helpful? Give feedback.
-
yes, to achieve the same without modifying the transform:
|
Beta Was this translation helpful? Give feedback.
-
I agree on 1., but why should the spatial_size be changed in any way? If we choose k appropriately (depending on foregorund extent), shouldn´t the spatial_size be kept the same? |
Beta Was this translation helpful? Give feedback.
-
sure, dilation k and spatial size are free parameters here, I just wanted to set them in this particular relation so that the sampling roughly achieves "not to be sampled in a centered way, but randomly in the patch." |
Beta Was this translation helpful? Give feedback.
-
@wyli Do you have some code working already? |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I noticed that
RandCropByPosNegLabel
always crops objects with the foreground pixels being in the center.Describe the solution you'd like
To get more variance into this transformation, I think it would be nice to have a flag indicating that the foreground voxel has not to be sampled in a centered way, but randomly in the patch. Especially for segmentation task with very few foreground voxels this would make sense IMO.
I am not entirely sure how that would affect model experiements but I would like to find out in case this gets implemented.
BTW: I absolutely love the functionality that this transformation already has!
Beta Was this translation helpful? Give feedback.
All reactions