Skip to content
Snippets Groups Projects
Commit 443dcd21 authored by Nassim Bouteldja's avatar Nassim Bouteldja
Browse files

Update computeFeatures.py

parent baeccb64
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,15 @@ import scipy.ndimage ...@@ -35,7 +35,15 @@ import scipy.ndimage
import scipy as sp import scipy as sp
from skimage.morphology import remove_small_objects from skimage.morphology import remove_small_objects
from utils import getBoundingBox
# Takes a binary mask image and outputs its bounding box
def getBoundingBox(img):
rows = np.any(img, axis=1)
cols = np.any(img, axis=0)
rmin, rmax = np.where(rows)[0][[0, -1]]
cmin, cmax = np.where(cols)[0][[0, -1]]
return rmin, rmax, cmin, cmax
# Computes sizes, diameters, and distance_to_closest_glom features for each glom # Computes sizes, diameters, and distance_to_closest_glom features for each glom
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment