Skip to content
Snippets Groups Projects
Commit 5617a733 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Removed min_sobel, which was there for debugging

parent 555ac744
No related branches found
No related tags found
No related merge requests found
...@@ -945,7 +945,7 @@ class RoiSet(object): ...@@ -945,7 +945,7 @@ class RoiSet(object):
ph, pw, pc, pz = patch3d.shape ph, pw, pc, pz = patch3d.shape
# make a 3d patch # make a 3d patch
if make_3d or not expanded: if make_3d:
patch = patch3d patch = patch3d
# make a 2d patch, find optimal z-position determined by focus_metric function on each channel separately # make a 2d patch, find optimal z-position determined by focus_metric function on each channel separately
...@@ -1166,7 +1166,7 @@ class RoiSet(object): ...@@ -1166,7 +1166,7 @@ class RoiSet(object):
def _poly_from_mask(roi): def _poly_from_mask(roi):
mask = roi.binary_mask mask = roi.binary_mask
if len(mask.shape) != 2: if len(mask.shape) != 2:
raise PatchMaskShapeError(f'Patch mask needs to be two dimensions to fit a polygon') raise PatchShapeError(f'Patch mask needs to be two dimensions to fit a polygon')
# label and fill holes # label and fill holes
labeled = label(mask) labeled = label(mask)
...@@ -1402,7 +1402,7 @@ class MissingSegmentationError(Error): ...@@ -1402,7 +1402,7 @@ class MissingSegmentationError(Error):
pass pass
class PatchMaskShapeError(Error): class PatchShapeError(Error):
pass pass
......
...@@ -125,6 +125,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase): ...@@ -125,6 +125,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
draw_bounding_box=True, draw_bounding_box=True,
expanded=True, expanded=True,
pad_to=256, pad_to=256,
make_3d=False,
) )
df = roiset.get_df() df = roiset.get_df()
for f in se_res: for f in se_res:
...@@ -133,6 +134,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase): ...@@ -133,6 +134,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
roi_q = df.loc[df.label == la, :] roi_q = df.loc[df.label == la, :]
self.assertEqual(len(roi_q), 1) self.assertEqual(len(roi_q), 1)
self.assertEqual((256, 256), acc.hw) self.assertEqual((256, 256), acc.hw)
self.assertEqual(1, acc.nz)
def test_make_tight_2d_patches(self): def test_make_tight_2d_patches(self):
roiset = self._make_roi_set() roiset = self._make_roi_set()
...@@ -140,7 +142,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase): ...@@ -140,7 +142,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
se_res = roiset.export_patches( se_res = roiset.export_patches(
where, where,
draw_bounding_box=True, draw_bounding_box=True,
expanded=False expanded=False,
) )
df = roiset.get_df() df = roiset.get_df()
for f in se_res: # all exported files are same shape as bounding boxes in RoiSet's datatable for f in se_res: # all exported files are same shape as bounding boxes in RoiSet's datatable
...@@ -150,6 +152,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase): ...@@ -150,6 +152,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
self.assertEqual(len(roi_q), 1) self.assertEqual(len(roi_q), 1)
roi = roi_q.iloc[0] roi = roi_q.iloc[0]
self.assertEqual((roi.h, roi.w), acc.hw) self.assertEqual((roi.h, roi.w), acc.hw)
self.assertEqual(1, acc.nz)
def test_make_expanded_3d_patches(self): def test_make_expanded_3d_patches(self):
roiset = self._make_roi_set() roiset = self._make_roi_set()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment