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

Export DataFrame from workflow

parent 34a01200
No related branches found
No related tags found
No related merge requests found
......@@ -40,5 +40,6 @@ class RoiSetExportParams(BaseModel):
patch_masks: bool = False
annotated_zstacks: Union[AnnotatedZStackParams, None] = None
object_classes: bool = False
dataframe: bool = False
......@@ -232,7 +232,8 @@ class TestZStackDerivedDataProducts(unittest.TestCase):
},
'patch_masks': True,
'annotated_zstacks': {},
'object_classes': True
'object_classes': True,
'dataframe': True,
})
infer_object_map_from_zstack(
......
......@@ -81,17 +81,9 @@ class RoiSet(object):
self.object_class_map = InMemoryDataAccessor(om)
# TODO: test
def get_object_mask_by_id(self, obj_id):
return self.object_id_labels == obj_id
def get_object_mask_by_class(self, class_id):
return self.object_id_labels == class_id
# TODO: implement
def get_object_patch_by_id(self, obj_id):
pass
def run_exports(self, where, channel, prefix, params: RoiSetExportParams):
if not self.count:
return
......@@ -129,7 +121,10 @@ class RoiSet(object):
write_accessor_data_to_file(subdir / (pr + '.tif'), annotated)
if k == 'object_classes':
write_accessor_data_to_file(subdir / (pr + '.tif'), self.object_class_map)
if k == 'dataframe':
dfpa = subdir / (pr + '.csv')
dfpa.parent.mkdir(parents=True, exist_ok=True)
self.df.to_csv(dfpa, index=False)
def build_zmask_from_object_mask(
......
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