Skip to content

Commit

Permalink
Update examples/06_secondary_labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompa committed Feb 17, 2023
1 parent 35bb6e2 commit 3f2ba78
Show file tree
Hide file tree
Showing 3 changed files with 470 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from devtools import debug

from fractal_tasks_core.cellpose_segmentation import cellpose_segmentation
from prototype_secondary_labeling import cellpose_segmentation_bis


if os.path.exists("tmp"):
Expand All @@ -19,6 +20,7 @@
zarr_path_mip = Path("tmp/*zarr")
with open("01_final_metadata.json", "r") as f:
metadata = json.load(f)
debug(metadata)


# Cellpose for organoids
Expand All @@ -36,9 +38,26 @@
cellprob_threshold=-3.0,
flow_threshold=0.4,
pretrained_model="model/Hummingbird.331986",
output_label_name="organoids",
output_label_name="organoids_ROI_table",
bounding_box_ROI_table_name="organoids_bbox_table",
)

debug(metadata)
with open("02_final_metadata.json", "w") as f:
json.dump(metadata, f, indent=4, sort_keys=True)
print("\n--------------------\n")

for component in metadata["image"]:
cellpose_segmentation_bis(
input_paths=[zarr_path_mip],
output_path=zarr_path_mip,
metadata=metadata,
component=component,
wavelength_id="A01_C01",
level=3,
relabeling=True,
diameter_level0=70.0,
ROI_table_name="organoids_bbox_table",
primary_label_ROI_table_name="organoids_ROI_table",
output_label_name="nuclei_ROI_table",
model_type="nuclei",
# cellprob_threshold=-3.0,
flow_threshold=0.4,
)
22 changes: 0 additions & 22 deletions examples/06_secondary_labeling/02_final_metadata.json

This file was deleted.

Loading

0 comments on commit 3f2ba78

Please sign in to comment.