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

Exposed export product flags in batch runner

parent 8fd758a5
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ from model_server.accessors import InMemoryDataAccessor, write_accessor_data_to_ ...@@ -9,7 +9,7 @@ from model_server.accessors import InMemoryDataAccessor, write_accessor_data_to_
if __name__ == '__main__': if __name__ == '__main__':
where_czi = Path( where_czi = Path(
'c:/Users/rhodes/projects/proj0004-marine-photoactivation/data/exp0038/AutoMic/20230906-163415/Selection' 'z:/rhodes/projects/proj0004-marine-photoactivation/data/exp0038/AutoMic/20230906-163415/Selection'
) )
where_output_root = Path( where_output_root = Path(
...@@ -54,6 +54,13 @@ if __name__ == '__main__': ...@@ -54,6 +54,13 @@ if __name__ == '__main__':
'mask_type': 'boxes', 'mask_type': 'boxes',
'zmask_filters': {'area': (1e3, 1e8)}, 'zmask_filters': {'area': (1e3, 1e8)},
'zmask_expand_box_by': (128, 3), 'zmask_expand_box_by': (128, 3),
'export_pixel_probabilities': False,
'export_2d_patches_for_training': True,
'export_2d_patches_for_annotation': False,
'export_3d_patches': False,
'export_annotated_zstack': False,
'export_patch_masks': False,
'export_patch_label_maps': True,
} }
result = export_patches_from_multichannel_zstack(**export_kwargs) result = export_patches_from_multichannel_zstack(**export_kwargs)
...@@ -61,7 +68,7 @@ if __name__ == '__main__': ...@@ -61,7 +68,7 @@ if __name__ == '__main__':
# parse and record results # parse and record results
df = result['dataframe'] df = result['dataframe']
df['source_path'] = ff df['source_path'] = ff
df.to_csv(where_output / 'df_objects.csv', **csv_args) df.to_csv(where_output / 'df_objects.csv', index=False, **csv_args)
pd.DataFrame(result['timer_results'], index=[0]).to_csv(where_output / 'timer_results.csv', **csv_args) pd.DataFrame(result['timer_results'], index=[0]).to_csv(where_output / 'timer_results.csv', **csv_args)
pd.json_normalize(export_kwargs).to_csv(where_output / 'workflow_params.csv', **csv_args) pd.json_normalize(export_kwargs).to_csv(where_output / 'workflow_params.csv', **csv_args)
csv_args = {'mode': 'a', 'header': False} # append to CSV from here on csv_args = {'mode': 'a', 'header': False} # append to CSV from here on
......
...@@ -24,10 +24,12 @@ def export_patches_from_multichannel_zstack( ...@@ -24,10 +24,12 @@ def export_patches_from_multichannel_zstack(
zmask_filters: Dict = None, zmask_filters: Dict = None,
zmask_expand_box_by: int = None, zmask_expand_box_by: int = None,
export_pixel_probabilities=True, export_pixel_probabilities=True,
export_2d_patches=True, export_2d_patches_for_training=True,
export_2d_patches_for_annotation=True,
export_3d_patches=True, export_3d_patches=True,
export_annotated_zstack=True, export_annotated_zstack=True,
export_patch_masks=True, export_patch_masks=True,
export_patch_label_maps=True,
) -> Dict: ) -> Dict:
ti = Timer() ti = Timer()
...@@ -81,7 +83,7 @@ def export_patches_from_multichannel_zstack( ...@@ -81,7 +83,7 @@ def export_patches_from_multichannel_zstack(
) )
ti.click('export_3d_patches') ti.click('export_3d_patches')
if export_2d_patches: if export_2d_patches_for_annotation:
files = export_multichannel_patches_from_zstack( files = export_multichannel_patches_from_zstack(
Path(where_output) / '2d_patches', Path(where_output) / '2d_patches',
stack, stack,
......
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