Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from tinalasisi/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
tinalasisi authored Nov 4, 2020
2 parents 4aeab08 + 3b9dd5e commit eaf8ced
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fibermorph/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.7"
__version__ = "0.2.8"
5 changes: 3 additions & 2 deletions fibermorph/fibermorph.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def crop_section(img, im_name, resolution, minpixel, maxpixel, im_center):
maxc = int(im_center[1] * 1.5)

bbox_pad = [minc, minr, maxc, maxr]
print("Error: \n Found no bbox for {} \n Used center 25% of image instead: {}".format(im_name, str(bbox_pad)))
# print("Error: \n Found no bbox for {} \n Used center 25% of image instead: {}".format(im_name, str(bbox_pad)))

crop_im = np.asarray(Image.fromarray(img).crop(bbox_pad))

Expand All @@ -461,7 +461,8 @@ def crop_section(img, im_name, resolution, minpixel, maxpixel, im_center):
def segment_section(crop_im, im_name, resolution, minpixel, maxpixel, im_center):
try:
thresh = skimage.filters.threshold_minimum(crop_im)
bin_img = skimage.segmentation.clear_border(crop_im < thresh)
bin_img = crop_im < thresh
# bin_img = skimage.segmentation.clear_border(crop_im < thresh)

# seg_im_inv = skimage.segmentation.chan_vese(crop_im, max_iter=200, init_level_set=bin_img)
seg_im = skimage.segmentation.morphological_chan_vese(np.asarray(crop_im), 40, init_level_set=bin_img, smoothing=4)
Expand Down

0 comments on commit eaf8ced

Please sign in to comment.