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

Hooked up overlay map to export runner

parent e8461666
No related branches found
No related tags found
No related merge requests found
...@@ -713,6 +713,11 @@ class RoiSet(object): ...@@ -713,6 +713,11 @@ class RoiSet(object):
else: else:
return acc_out return acc_out
def export_object_identities_overlay_map(self, where, white_channel, prefix='obmap_overlay', **kwargs) -> str:
acc = self.get_object_identities_overlay_map(white_channel=white_channel, **kwargs)
fp = where / (prefix + '.tif')
return acc.write(fp, composite=True).name
def get_serializable_dataframe(self) -> pd.DataFrame: def get_serializable_dataframe(self) -> pd.DataFrame:
return self._df.drop(['expanded_slice', 'slice', 'relative_slice', 'binary_mask'], axis=1) return self._df.drop(['expanded_slice', 'slice', 'relative_slice', 'binary_mask'], axis=1)
...@@ -973,6 +978,8 @@ class RoiSet(object): ...@@ -973,6 +978,8 @@ class RoiSet(object):
fp.parent.mkdir(exist_ok=True, parents=True) fp.parent.mkdir(exist_ok=True, parents=True)
dacc.export_pyxcz(fp) dacc.export_pyxcz(fp)
record[k].append(str(fp)) record[k].append(str(fp))
if k == 'labels_overlay':
record[k] = str(Path(k) / self.export_object_identities_overlay_map(subdir, white_channel=channel, **kp))
# export dataframe and patch masks # export dataframe and patch masks
record = {**record, **self.serialize(where, prefix=prefix)} record = {**record, **self.serialize(where, prefix=prefix)}
......
...@@ -390,6 +390,14 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa ...@@ -390,6 +390,14 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
self.assertEqual(acc_out.nz, 1) self.assertEqual(acc_out.nz, 1)
acc_out.write(where / 'overlay_composite_mip.tif', composite=True) acc_out.write(where / 'overlay_composite_mip.tif', composite=True)
# export via .run_exports() method
self.roiset.run_exports(
where,
channel=-1,
prefix='run_exports',
params=RoiSetExportParams(**{'labels_overlay': {'transparency': 0.2, 'mip': True, 'rescale_clip': 0.00}})
)
def test_multichannel_annotated_zstack(self): def test_multichannel_annotated_zstack(self):
......
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