nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
145 stars 54 forks source link

mindboggle.labels.labels.extract_boundaries() ignores vertices adjacent to more than 2 labels. #17

Closed ohinds closed 11 years ago

ohinds commented 11 years ago

The condition that

len(set(x)) == 2

when building boundary_indices ensures that vertices on the boundary of more than 2 labels will not be labelled as on a boundary. This doesn't seem like desired behavior, and contradicts the documentation for the function, which says: "Label boundaries are the set of all vertices whose neighbors do not share the same label.".

One way to fix this would be to change the condition to

len(set(x)) >= 2

but I'm not sure if this would break assumptions in the rest of MB about each boundary_label_pair really being of length 2.

binarybottle commented 11 years ago

Thank you, Oliver. When I wrote this I wanted to compare boundary_label_pairs with sulcus label pairs in the DKT labeling protocol. However, I looked up all instances in the code base, and if the boundary pairs were actually tuples, nothing should break; these vertices would simply be ignored (as they are currently). So I have made your suggested change and have changed "boundaries" to "borders" and "pairs" to "tuples" (as in "border_label_tuples") throughout and will push these changes soon.