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

Allow return of labelids in find_parcel_centroids #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pvandyken
Copy link

I was working with an atlas (Brainnetome) that interleaves nodes from each hemisphere (e.g. 1=L, 2=R, 3=L, 4=R, ...). find_parcel_centroids separates the two hemispheres in its return, such that all nodes from the left hemisphere come first, followed by the right. This disrupts the order of the nodes to something like (1, 3, 5, 7, ..., 2, 4, 6, 8, ...)

To remedy this, I added a flag allowing the return of the label ids associated with each centroid, which in turn can be used to resort everything. The flag is False by default, so there's no breaking change in behaviour.

If you're interested in incorporating this, I'm happy to provide any tests as required, and any additional documentation (although this PR already updates the docstring).

Adds optional boolean flag (get_labelids) which, if True, causes
find_parcel_centroids to return a 1D ndarray of labels corresponding to
the centroids.
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.

1 participant