Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a piece of code to quickly loop over structured (ROI label) data. While
pytest
does run, it should be considered WIP. Also, to run thepytest
code, the pytest-benchmark plugin should be installed before running.Most of the modifications are designed to operate with the use of a
use_fastloop
parameter, but function overloading was used so that no breaking changes were made.The performance improvements on phase 1 come primarily from implementation of a fast run length encoding (RLE) algorithm that reduces the initial pass over the pixels by a factor of 5-10x. Overall, the reduction of processing time using the pytest benchmarks averages about 20%, but this is only for calculating all intensity features.
Since the RLE algorithm is fast, it might be beneficial to use RLE for calculating some of the features in Nyxus. For example, RLE effectively creates a pseudo-hull, drastically reducing the number of calculations for things like convex hull. This would be future work since some algorithms like convex hull could use RLE as a drop in replacement while other features might require retooling to take full advantage of RLE.