FEAT: bounding box getter, union, cropping #56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features/fixes
Added the following method of
ObjectandBoundingBox:Object.get_roi: Get the object in the ROI defined by the bounding box as a tensor.Object.get_probe_position_frame_roi_bounding_box: Get the ROI bounding box whose bounds are given by the limits of probe positions.Object.get_pixel_frame_roi_bounding_box: Get the ROI bounding box whose bounds are given in pixel indices of the object buffer. (0, 0) is the top left corner.BoundingBox.union: take the union of the current bounding box and another.BoundingBox.get_sliceris changed so that when the origin of the current bounding box is not (0, 0) (i.e. its bounds are not pixel coordinates), it first converts the bounding box to a pixel coordinate one usingget_bbox_with_top_left_origin.Example of combining the bounding boxes of 2
PlanarObjectobjects and cropping the object using the union of the boxes:Related issues (optional)
#51
Mentions
@yijiang1
Checklist
Have you...