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

Support checking select_fn on "all" channels in generate_spatial_bounding_box #7709

Closed
function2-llx opened this issue Apr 25, 2024 · 1 comment

Comments

@function2-llx
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When apply transform like CropForeground to a multichannel image, the bounding box is determined by checking select_fn on "any" channel. However, in many cases, we may want to check it on "all" channels, e.g., when cropping RGB images, we discard background pixels with all 3 channels being zero, instead of pixels with any one of the channel being zero.

data = select_fn(data).any(0)

Describe the solution you'd like
Add some option indicating that we should call select_fn(data).all(0) in the line of code above.

@function2-llx
Copy link
Contributor Author

After rethinking, I think I made a mistake. The current implementation is exactly what I want. I apologize for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant