seung-lab / connected-components-3d

Connected components on discrete and continuous multilabel 3D & 2D images. Handles 26, 18, and 6 connected variants; periodic boundaries (4, 8, & 6)
GNU Lesser General Public License v3.0
356 stars 42 forks source link

feat: cc3d.contacts (region_graph + surface area or contact count) #93

Closed william-silversmith closed 2 years ago

william-silversmith commented 2 years ago

Adds function cc3d.contacts which returns a dict of label tuples that map to either the contact surface area or the number of voxel contacts.

cc3d.contacts(labels, connectivity=26, surface_area=True, anisotropy=(1,1,1))

cc3d.region_graph is retained for backwards compatibility, but all functionality is delegated to contacts as it's just the set of keys returned from contacts.