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

generate_pixel_cluster_mask is really slow #535

Closed
ngreenwald opened this issue Apr 30, 2022 · 3 comments · Fixed by #546
Closed

generate_pixel_cluster_mask is really slow #535

ngreenwald opened this issue Apr 30, 2022 · 3 comments · Fixed by #546
Assignees
Labels
enhancement New feature or request

Comments

@ngreenwald
Copy link
Member

Is your feature request related to a problem? Please describe.
This function is extremely slow.

Describe the solution you'd like
We should look and see if using alternative indexing, similar to what regionprops does, can lead to a performance speedup

@ngreenwald ngreenwald added the enhancement New feature or request label Apr 30, 2022
@alex-l-kong
Copy link
Contributor

Currently, I'm trying to work a solution that uses 1D indexing; 2D arrays are notorious for cache misses. I've timed it and we get a significant speed up (around 3-3.5x per FOV), just need to ensure correctness.

@ngreenwald
Copy link
Member Author

Got it. I remember when we switched to tuple-based indexing in segmentation it also provided a massive speedup. Not sure if this works for reassignment as well or just for getting values out of the array, can you take a look and see how this compares in terms of performance?

channel_values = image_data.values[tuple(cell_coords.T)]

@alex-l-kong
Copy link
Contributor

@ngreenwald sure, I'll do some timing analysis on my end and see which one ends up working faster.

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

Successfully merging a pull request may close this issue.

2 participants