Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-grim authored Oct 12, 2024
1 parent 4b6e674 commit 4c8061a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/deep_neurographs/utils/img_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,15 @@ def get_minimal_bbox(voxels, buffer=0):
return bbox


def get_fixed_bbox(voxels, shape):
centroid = np.round(np.mean(voxels, axis=0)).astype(int)
bbox = {
"min": [centroid[i] - shape[i] // 2 for i in range(3)],
"max": [centroid[i] + shape[i] // 2 for i in range(3)],
}
return bbox


def find_img_path(bucket_name, img_root, dataset_name):
"""
Find the path of a specific dataset in a GCS bucket.
Expand Down

0 comments on commit 4c8061a

Please sign in to comment.