You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
Thanks for raising this up.
Actually, we have a duplicated ticket: #586
Could you please help submit a PR for this new transform if you are interested?
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
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?
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."
Activity
Nic-Ma commentedon Mar 18, 2021
Hi @lukasfolle ,
Thanks for raising this up.
Actually, we have a duplicated ticket: #586
Could you please help submit a PR for this new transform if you are interested?
Thanks.
wyli commentedon Mar 18, 2021
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
lukasfolle commentedon Mar 18, 2021
@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.
wyli commentedon Mar 18, 2021
yes, to achieve the same without modifying the transform:
lukasfolle commentedon Mar 18, 2021
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?
wyli commentedon Mar 18, 2021
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."
lukasfolle commentedon Mar 18, 2021
@wyli Do you have some code working already?