diff --git a/extensions/chaeo/annotators.py b/extensions/chaeo/annotators.py index 145e1505cc1f2939ebf0b6fa0fda0959ca47fd8a..eb4996c30a1f23de8731a4e74ac4d0ba88ef5aa0 100644 --- a/extensions/chaeo/annotators.py +++ b/extensions/chaeo/annotators.py @@ -24,7 +24,7 @@ def draw_boxes_on_2d_image(yx_img, boxes, **kwargs): draw.rectangle([(x0, y0), (x1, y1)], outline='white', width=linewidth) if kwargs.get('add_label') is True: - draw.text((xm, y0), f'Z{zi:04d}-L{la:04d}', fill='white', anchor='mb') + draw.text((xm, y0), f'{la:04d}', fill='white', anchor='mb') return pilimg diff --git a/extensions/chaeo/batch_jobs/20231023_Porto_EtOHfixed.py b/extensions/chaeo/batch_jobs/20231023_Porto_EtOHfixed.py index 45ee113035f0511b8e32d9753063160e2db29538..ebfec6cea60bd3a92c0930593919ace67c576ef9 100644 --- a/extensions/chaeo/batch_jobs/20231023_Porto_EtOHfixed.py +++ b/extensions/chaeo/batch_jobs/20231023_Porto_EtOHfixed.py @@ -34,7 +34,8 @@ if __name__ == '__main__': 'export_patch_masks': True, 'zmask_clip': 0.01, 'rgb_overlay_channels': (1, None, None), - 'rgb_overlay_weights': (0.2, 1.0, 1.0) + 'rgb_overlay_weights': (0.2, 1.0, 1.0), + 'draw_label_on_zstack': True, } input_files = get_matching_files(where_czi, 'czi', coord_filter={}) diff --git a/extensions/chaeo/ecotaxa.py b/extensions/chaeo/ecotaxa.py index 770b5b74798d65bd7f7a7cb3bc133ef781982db3..12a8bb6d494ca3eb18b80c4acbfc9fc6bf3d9f71 100644 --- a/extensions/chaeo/ecotaxa.py +++ b/extensions/chaeo/ecotaxa.py @@ -26,6 +26,7 @@ def write_ecotaxa_tsv(patches_csv_path: str, where: str, sample_id: str, scope_i df_patches.loc[:, ('acq_id', '[t]')] = df_patches.loc[:, ('input_file', '[t]')] df_patches.loc[:, ('object_id', '[t]')] = df_patches.loc[:, ('patch_id', '[t]')] df_patches.loc[:, ('process_id', '[t]')] = df_patches.loc[:, ('patch_id', '[t]')] + df_patches.loc[:, ('acq_pixel_scale_in_micrometers', '[f]')] = df_patches.loc[:, ('pixel_scale_in_micrometers', '[f]')] cols_to_transfer = [ 'img_file_name', diff --git a/extensions/chaeo/workflows.py b/extensions/chaeo/workflows.py index 8da67916e7e3a1dc408d8e15cd950afa48743151..57072bb835d46bf6b83dc5521a12b9693fd04018 100644 --- a/extensions/chaeo/workflows.py +++ b/extensions/chaeo/workflows.py @@ -67,6 +67,9 @@ def get_zmask_meta( ) ti.click('generate_zmasks') + # record pixel scale + df['pixel_scale_in_micrometers'] = float(stack.pixel_scale_in_micrometers.get('X')) + return ti, stack, fstem, obmask, pxmap, zmask, zmask_meta, df, interm @@ -92,6 +95,7 @@ def export_patches_from_multichannel_zstack( draw_mask_on_2d_patch=False, export_3d_patches=True, export_annotated_zstack=True, + draw_label_on_zstack=False, export_patch_masks=True, rgb_overlay_channels=(None, None, None), rgb_overlay_weights=(1.0, 1.0, 1.0), @@ -165,7 +169,6 @@ def export_patches_from_multichannel_zstack( make_3d=False, focus_metric='max_sobel', ) - df_patches = pd.DataFrame(files) ti.click('export_2d_patches') if export_patch_masks: @@ -180,7 +183,8 @@ def export_patches_from_multichannel_zstack( annotated = InMemoryDataAccessor( draw_boxes_on_3d_image( stack.get_one_channel_data(patches_channel).data, - zmask_meta + zmask_meta, + add_label=draw_label_on_zstack, ) ) write_accessor_data_to_file(