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

Test that zmask can also be single z-slice

parent 37181f33
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ from extensions.chaeo.conf.testing import multichannel_zstack, pixel_classifier,
from extensions.chaeo.products import export_patches_from_zstack, export_multichannel_patches_from_zstack, export_patch_masks_from_zstack
from extensions.chaeo.zmask import build_zmask_from_object_mask
from model_server.accessors import generate_file_accessor, InMemoryDataAccessor, write_accessor_data_to_file
from extensions.ilastik.models import IlastikObjectClassifierModel, IlastikPixelClassifierModel
from extensions.ilastik.models import IlastikPixelClassifierModel
class TestZStackDerivedDataProducts(unittest.TestCase):
......@@ -57,6 +57,18 @@ class TestZStackDerivedDataProducts(unittest.TestCase):
return zmask, meta
def test_zmask_works_on_non_zstacks(self, **kwargs):
acc_zstack_slice = InMemoryDataAccessor(self.stack.data[:, :, 0, 0])
self.assertEqual(acc_zstack_slice.nz, 1)
zmask, meta, df, interm = build_zmask_from_object_mask(
self.obmap.get_one_channel_data(0),
acc_zstack_slice,
mask_type='boxes',
**kwargs,
)
zmask_acc = InMemoryDataAccessor(zmask)
self.assertTrue(zmask_acc.is_mask())
def test_zmask_makes_correct_contours(self):
return self.test_zmask_makes_correct_boxes(mask_type='contours')
......
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