Skip to content

python: Add new functions unique() and relabelConsecutive()#339

Merged
ukoethe merged 5 commits intoukoethe:version-1-11-rcfrom
stuarteberg:add-relabel-consecutive
Feb 28, 2016
Merged

python: Add new functions unique() and relabelConsecutive()#339
ukoethe merged 5 commits intoukoethe:version-1-11-rcfrom
stuarteberg:add-relabel-consecutive

Conversation

@stuarteberg
Copy link
Copy Markdown
Contributor

This PR adds two more functions that are helpful when dealing with huge label volumes. This implementation of unique() is 3x faster than numpy.unique(). Similarly, this implementation ofrelabelConsecutive() is much faster than the best python implementation I could come up with.

@stuarteberg stuarteberg force-pushed the add-relabel-consecutive branch 2 times, most recently from 94a5ea8 to bcb412d Compare February 26, 2016 23:30
@stuarteberg stuarteberg force-pushed the add-relabel-consecutive branch 2 times, most recently from 6ae1dc5 to 3030e28 Compare February 26, 2016 23:38
@stuarteberg stuarteberg force-pushed the add-relabel-consecutive branch from 3030e28 to d8fbeef Compare February 26, 2016 23:40
NumpyAnyArray
pythonUnique(NumpyArray<NDIM, Singleband<VoxelType> > src)
{
boost::unordered_set<VoxelType> labelset;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to prefer boost:: over std:: here?

@stuarteberg stuarteberg force-pushed the add-relabel-consecutive branch from cf8a7e6 to e22a0ef Compare February 27, 2016 17:25
@stuarteberg stuarteberg force-pushed the add-relabel-consecutive branch from e22a0ef to 4921270 Compare February 27, 2016 17:27
@stuarteberg
Copy link
Copy Markdown
Contributor Author

Thanks again for the careful review. I've updated the code to implement your suggestions.

ukoethe added a commit that referenced this pull request Feb 28, 2016
python: Add new functions unique() and relabelConsecutive()
@ukoethe ukoethe merged commit 9f9f9cd into ukoethe:version-1-11-rc Feb 28, 2016
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

Successfully merging this pull request may close these issues.

2 participants