diff --git a/model_server/extensions/chaeo/tests/test_zstack.py b/model_server/extensions/chaeo/tests/test_zstack.py index b5744062623f41f67839367909a9c7226751de80..dfc548db225c27ac850bb40d4c8be7a6ce8814ae 100644 --- a/model_server/extensions/chaeo/tests/test_zstack.py +++ b/model_server/extensions/chaeo/tests/test_zstack.py @@ -257,7 +257,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa def test_multichannel_to_mono_2d_patches(self): files = export_multichannel_patches_from_zstack( - output_path / 'test_multichannel_to_mono_2d_patches', + output_path / 'multichannel' / 'mono_2d_patches', self.roiset, white_channel=3, draw_bounding_box=True, @@ -267,7 +267,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa def test_multichannnel_to_mono_2d_patches_rgb_bbox(self): files = export_multichannel_patches_from_zstack( - output_path / 'multichannnel_to_mono_2d_patches_rgb_bbox', + output_path / 'multichannel' / 'mono_2d_patches_rgb_bbox', self.roiset, white_channel=3, draw_bounding_box=True, @@ -278,7 +278,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa def test_multichannnel_to_rgb_2d_patches_bbox(self): files = export_multichannel_patches_from_zstack( - output_path / 'multichannnel_to_rgb_2d_patches_bbox', + output_path / 'multichannel' / 'rgb_2d_patches_bbox', self.roiset, white_channel=4, rgb_overlay_channels=(3, None, None), @@ -291,7 +291,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa def test_multichannnel_to_rgb_2d_patches_contour(self): files = export_multichannel_patches_from_zstack( - output_path / 'multichannnel_to_rgb_2d_patches_contour', + output_path / 'multichannel' / 'rgb_2d_patches_contour', self.roiset, rgb_overlay_channels=(3, None, None), draw_contour=True, @@ -303,12 +303,22 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa self.assertEqual(result.get_one_channel_data(2).data.max(), 0) # blue channel is black def test_multichannel_to_multichannel_tif_patches(self): - # roiset = self._setup_multichannel_tests() files = export_multichannel_patches_from_zstack( - output_path / 'multichannel_to_multichannel_tif_patches', + output_path / 'multichannel' / 'multichannel_tif_patches', self.roiset, ) result = generate_file_accessor(Path(files[0]['location']) / files[0]['patch_filename']) self.assertEqual(result.chroma, 5) + def test_multichannel_annotated_zstack(self): + self.roiset.export_annotated_zstack( + output_path / 'multichannel' / 'annotated_zstack', + 'test_multichannel_annotated_zstack', + ) + # files = export_multichannel_patches_from_zstack( + # output_path / 'multichannel_to_multichannel_tif_patches', + # self.roiset, + # ) + # result = generate_file_accessor(Path(files[0]['location']) / files[0]['patch_filename']) + # self.assertEqual(result.chroma, 5) diff --git a/model_server/extensions/chaeo/zmask.py b/model_server/extensions/chaeo/zmask.py index f0cd31705fbe02b77718509a1341b11ab199eafd..4ed84a6babde297f216ae2048e0a3dd6922cfc2e 100644 --- a/model_server/extensions/chaeo/zmask.py +++ b/model_server/extensions/chaeo/zmask.py @@ -203,9 +203,7 @@ class RoiSet(object): return Multichannel3dPatchStack(patches) def export_annotated_zstack(self, where, prefix='zstack', **kwargs): - annotated = InMemoryDataAccessor(draw_boxes_on_3d_image(self, **kwargs) - # draw_boxes_on_3d_image(self.acc_raw.data, self.zmask_meta, **kwargs) # TODO remove zmask_meta ref - ) + annotated = InMemoryDataAccessor(draw_boxes_on_3d_image(self, **kwargs)) success = write_accessor_data_to_file(where / (prefix + '.tif'), annotated) return {'location': where.__str__(), 'filename': prefix + '.tif'}