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

Corrected bounding box annotation

parent c35f657e
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ if __name__ == '__main__':
'mask_type': 'boxes',
'zmask_filters': {'area': (1e3, 1e8)},
'zmask_expand_box_by': (128, 3),
'annotate_focus_metric': 'rms_sobel'
'annotate_focus_metric': 'max_sobel'
}
result = export_patch_focus_metrics_from_multichannel_zstack(**export_kwargs)
......
......@@ -98,7 +98,7 @@ def export_3d_patches_with_focus_metrics(
Export 3D patches as multi-level z-stacks, along with CSV of various focus methods for each z-position
:param kwargs:
annotate_focus_metric: name focus metric to use when drawing bounding box at optimal focus z-position
annotate_focus_metric: name focus metric to use when drawing bounding box at optimal focus z-position
:return:
list of exported files
"""
......@@ -150,7 +150,8 @@ def export_3d_patches_with_focus_metrics(
me_df = pd.DataFrame(me_dict).T
# drawing bounding box only on focused slice
if ak := kwargs.get('annotate_focus_metric') in me_dict.keys():
ak = kwargs.get('annotate_focus_metric')
if ak and ak in me_df.columns:
zi_foc = me_df.idxmax().to_dict()[ak]
patch[:, :, 0, zi_foc] = draw_box_on_patch(
patch[:, :, 0, zi_foc],
......
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