Skip to content

How do we interpret bounding box slices? #94

Discussion options

You must be logged in to vote

Thank you for writing in! I really appreciate that you're getting a lot of use out of this library!

The bounding boxes are designed to make it easy to obtain a cutout from the output connected component labels (let's call them cc_labels). The dimensions of the bounding boxes are a close crop (the minimum sized box) needed to enclose a label with a parallelepiped geometry.

Let's assume I want to access the cutout of connected component label 5:

cc_labels, N = cc3d.connected_components(labels, return_N=True)
assert N >= 5, "Not enough connected components"
stats = cc3d.statistics(cc_labels)
bboxes = stats["bounding_boxes"]

cutout = cc_labels[bboxes[5]]

This is kind of similar to how scipy …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jchubber
Comment options

Answer selected by jchubber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants