Skip to content

Commit

Permalink
Merge branch 'singleplex-app' of https://github.com/vanvalenlab/deepc…
Browse files Browse the repository at this point in the history
…ell-spots into singleplex-app
  • Loading branch information
elaubsch committed Jan 27, 2022
2 parents 6c00c0a + 694262b commit 760e4ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions deepcell_spots/applications/polaris.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import tensorflow as tf

from deepcell.applications import CytoplasmSegmentation

from deepcell_spots.applications import SpotDetection
from deepcell_spots.singleplex import match_spots_to_cells
from deepcell_toolbox.processing import histogram_normalization
Expand Down Expand Up @@ -87,9 +88,7 @@ def __init__(self,
def predict(self,
image,
image_mpp=None,
# segmentation
cytoplasm_channel=0,
# spots
spots_channel=1,
threshold=0.95,
clip=False):
Expand Down Expand Up @@ -144,11 +143,11 @@ def predict(self,

result = []
for i in range(len(spots_result)):
spots_dict = match_spots_to_cells(segmentation_result[i:i + 1, :, :, :],
spots_dict = match_spots_to_cells(segmentation_result[i:i + 1],
spots_result[i])

result.append({'spots_assignment': spots_dict,
'cell_segmentation': segmentation_result[i:i + 1, :, :, :],
'cell_segmentation': segmentation_result[i:i + 1],
'spot_locations': spots_result[i]})

return result
2 changes: 1 addition & 1 deletion deepcell_spots/applications/spot_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def predict(self,
"""

if threshold < 0 or threshold > 1:
raise ValueError("""Threshold value must be between 0 and 1.""")
raise ValueError('Threshold value must be between 0 and 1.')

if preprocess_kwargs is None:
preprocess_kwargs = {
Expand Down

0 comments on commit 760e4ca

Please sign in to comment.