Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
philipmac committed Sep 7, 2023
1 parent c681f3b commit c9ad687
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion em_workflows/czi/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def find_thumb_idx(callback: List[Dict]) -> List[Dict]:
fps = utils.gen_fps(input_dir=input_dir_fp, fps_in=input_fps)
prim_fps = utils.gen_prim_fps.map(fp_in=fps)
imageSets = bioformats_gen_zarr.map(file_path=fps)
callback_with_zarrs = utils.add_asset.map(prim_fp=prim_fps, asset=imageSets)
callback_with_zarrs = utils.add_imageSet.map(prim_fp=prim_fps, imageSet=imageSets)
callback_with_zarrs = find_thumb_idx(callback=callback_with_zarrs)
filtered_callback = utils.filter_results(callback_with_zarrs)
cb = utils.send_callback_body(
Expand Down
21 changes: 13 additions & 8 deletions em_workflows/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ def gen_prim_fps(fp_in: FilePath) -> Dict:
return base_elts


@task
def add_imageSet(prim_fp: dict, imageSet: dict) -> Dict:
prim_fp["imageSet"] = imageSet
return prim_fp


@task
def add_asset(prim_fp: dict, asset: dict, image_idx: int = None) -> dict:
"""
Expand Down Expand Up @@ -145,14 +151,13 @@ def add_asset(prim_fp: dict, asset: dict, image_idx: int = None) -> dict:
the FilePath object at runtime.
"""

prim_fp["imageSet"] = asset
# if not image_idx:
# image_idx = 0
# if type(asset) is list:
# prim_fp["imageSet"][image_idx]["assets"].extend(asset)
# else:
# prim_fp["imageSet"][image_idx]["assets"].append(asset)
# log(f"Added fp elt {asset} to {prim_fp}, at index {image_idx}.")
if not image_idx:
image_idx = 0
if type(asset) is list:
prim_fp["imageSet"][image_idx]["assets"].extend(asset)
else:
prim_fp["imageSet"][image_idx]["assets"].append(asset)
log(f"Added fp elt {asset} to {prim_fp}, at index {image_idx}.")
return prim_fp


Expand Down

0 comments on commit c9ad687

Please sign in to comment.