diff --git a/extensions/chaeo/examples/batch_run_patches.py b/extensions/chaeo/examples/batch_run_patches.py index fb96be1ac1815a1737156ee7575ca550180f8c50..2900f060758d7fca2de5723e27ad628394ebd384 100644 --- a/extensions/chaeo/examples/batch_run_patches.py +++ b/extensions/chaeo/examples/batch_run_patches.py @@ -14,7 +14,7 @@ if __name__ == '__main__': ) where_output_root = Path( - 'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0009' + 'c:/Users/rhodes/projects/proj0011-plankton-seg/exp0009/output' ) yyyymmdd = strftime('%Y%m%d', localtime()) idx = 0 @@ -51,7 +51,7 @@ if __name__ == '__main__': } result = export_patches_from_multichannel_zstack(**export_kwargs) - break + # parse and record results df = result['dataframe'] df['filename'] = ff.name @@ -65,4 +65,4 @@ if __name__ == '__main__': write_accessor_data_to_file( where_output / k / (ff.stem + '.tif'), InMemoryDataAccessor(result['interm'][k]) - ) \ No newline at end of file + ) \ No newline at end of file diff --git a/extensions/chaeo/tests/test_zstack.py b/extensions/chaeo/tests/test_zstack.py index 2257b90b360e7bc744b70cff0e28c634c152b195..c2d0b1136ad8a3c3f99c4611c57fb12d04664740 100644 --- a/extensions/chaeo/tests/test_zstack.py +++ b/extensions/chaeo/tests/test_zstack.py @@ -100,7 +100,7 @@ class TestZStackDerivedDataProducts(unittest.TestCase): from extensions.chaeo.zmask import project_stack_from_focal_points - dff = df[df['keeper'] == True] + dff = df[df['keeper']] img = project_stack_from_focal_points( dff['centroid-0'].to_numpy(), diff --git a/extensions/chaeo/workflows.py b/extensions/chaeo/workflows.py index 14e3fd2dcd5a8d4c2168c491080c6759abba7850..23eab18fc40ff4f2e9898525dde4f543d595764a 100644 --- a/extensions/chaeo/workflows.py +++ b/extensions/chaeo/workflows.py @@ -4,7 +4,7 @@ from typing import Dict from extensions.ilastik.models import IlastikPixelClassifierModel from extensions.chaeo.annotators import draw_boxes_on_3d_image from extensions.chaeo.products import export_patches_from_zstack -from extensions.chaeo.zmask import build_zmask_from_object_mask +from extensions.chaeo.zmask import build_zmask_from_object_mask, project_stack_from_focal_points from model_server.accessors import generate_file_accessor, InMemoryDataAccessor, write_accessor_data_to_file from model_server.workflows import Timer @@ -83,15 +83,15 @@ def export_patches_from_multichannel_zstack( ) ti.click('export_annotated_zstack') - # from extensions.chaeo.zmask import build_image_flattening_zmask_from_points - # - # dff = df[df['keeper'] == True] - # build_image_flattening_zmask_from_points( - # dff['centroid-0'], - # dff['centroid-1'], - # dff['zi'], - # stack.get_one_channel_data(patches_channel).data, - # ) + # generate multichannel projection from label centroids + dff = df[df['keeper']] + interm['projected'] = project_stack_from_focal_points( + dff['centroid-0'].to_numpy(), + dff['centroid-1'].to_numpy(), + dff['zi'].to_numpy(), + stack, + degree=4, + ) return { 'pixel_model_id': px_model.model_id,