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

Test covering annotated multichannel z-stacks, too

parent 820cc3e3
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......@@ -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'}
......
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