Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blob segmentation #92

Merged
merged 4 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/release/release_v1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#### Cell detection

- Fixed blob segmentation for newer versions of Scikit-image (#91)

#### Volumetric image processing

#### I/O
Expand Down
3 changes: 1 addition & 2 deletions magmap/cv/segmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""Segment regions based on blobs, labels, and underlying features.
"""

from multiprocessing import sharedctypes
from time import time
from typing import Any, List, Optional, Tuple, Union

Expand Down Expand Up @@ -626,7 +625,7 @@ def watershed_distance(foreground, markers=None, num_peaks=np.inf,
local_max = feature.peak_local_max(
distance, indices=False, num_peaks=num_peaks)
markers = measure.label(local_max)
watershed = morphology.watershed(
watershed = segmentation.watershed(
-distance, markers, compactness=compactness, mask=mask)
return watershed

Expand Down
16 changes: 9 additions & 7 deletions magmap/gui/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ class Visualization(HasTraits):
_segs_moved = [] # orig seg of moved blobs to track for deletion
_scale_detections_low = 0.0
_scale_detections_high = Float # needs to be trait to dynamically update
scale_detections = Float
scale_detections = Float(
tooltip="Change the size of blobs in the 3D viewer"
)
segs_pts = None
segs_selected = List # indices
# multi-select to allow updating with a list, but segment updater keeps
Expand Down Expand Up @@ -442,11 +444,11 @@ class Visualization(HasTraits):
"Panes: show back and top panes\n"
"Shadows: show blob shadows as circles")
_check_list_2d = List(
tooltip="Filtered: show filtered image after detection\n"
"Border: margin around ROIs\n"
"Seg: segment blobs\n"
"Grid: overlay a grid\n"
"MIP: maximum intensity projection")
tooltip="Filtered: show filtered image after detection in ROI planes\n"
"Border: margin around ROI planes\n"
"Seg: segment blobs during detection in ROI planes\n"
"Grid: overlay a grid in ROI planes\n"
"MIP: maximum intensity projection in overview images")
_DEFAULTS_2D = [
"Filtered", "Border", "Seg", "Grid", "MIP"]
_planes_2d = List
Expand Down Expand Up @@ -624,7 +626,7 @@ class Visualization(HasTraits):
values=[e.value for e in BlobColorStyles],
format_func=lambda x: x)),
),
Item("scale_detections",
Item("scale_detections", label="Scale 3D blobs",
editor=RangeEditor(
low_name="_scale_detections_low",
high_name="_scale_detections_high",
Expand Down