Skip to content

Commit

Permalink
BROKEN add test for multiplexing beyond-parsing workflow (ref #199)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompa committed Nov 24, 2022
1 parent 2c20a2a commit df7f62b
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions tests/test_workflows_multiplexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@
from fractal_tasks_core.create_zarr_structure_multiplex import (
create_zarr_structure_multiplex,
)
from fractal_tasks_core.replicate_zarr_structure import (
replicate_zarr_structure,
) # noqa
from fractal_tasks_core.yokogawa_to_zarr import yokogawa_to_zarr

# from fractal_tasks_core.maximum_intensity_projection import (
# maximum_intensity_projection,
# ) # noqa


single_cycle_channel_parameters = {
"A01_C01": {
Expand Down Expand Up @@ -99,3 +106,75 @@ def test_workflow_multiplexing(

check_file_number(zarr_path=image_zarr_0)
check_file_number(zarr_path=image_zarr_1)


def test_workflow_multiplexing_MIP(
tmp_path: Path, zenodo_images_multiplex: Sequence[Path]
):

# Init
img_paths = [
cycle_folder / "*.png" for cycle_folder in zenodo_images_multiplex
]
zarr_path = tmp_path / "tmp_out/*.zarr"
zarr_path_mip = tmp_path / "tmp_out_mip/*.zarr"
metadata = {}

# Create zarr structure
debug(img_paths)
metadata_update = create_zarr_structure_multiplex(
input_paths=img_paths,
output_path=zarr_path,
channel_parameters=channel_parameters,
num_levels=num_levels,
coarsening_xy=coarsening_xy,
metadata_table="mrf_mlf",
)
metadata.update(metadata_update)
debug(metadata)

# Yokogawa to zarr
for component in metadata["image"]:
yokogawa_to_zarr(
input_paths=[zarr_path],
output_path=zarr_path,
metadata=metadata,
component=component,
)
debug(metadata)

# Replicate
metadata_update = replicate_zarr_structure(
input_paths=[zarr_path],
output_path=zarr_path_mip,
metadata=metadata,
project_to_2D=True,
suffix="mip",
)
metadata.update(metadata_update)
debug(metadata)

"""
# MIP
for component in metadata["image"]:
maximum_intensity_projection(
input_paths=[zarr_path_mip],
output_path=zarr_path_mip,
metadata=metadata,
component=component,
)
# OME-NGFF JSON validation
image_zarr_0 = Path(zarr_path.parent / metadata["image"][0])
image_zarr_1 = Path(zarr_path.parent / metadata["image"][1])
well_zarr = image_zarr_0.parent
plate_zarr = image_zarr_0.parents[2]
validate_schema(path=str(image_zarr_0), type="image")
validate_schema(path=str(image_zarr_1), type="image")
validate_schema(path=str(well_zarr), type="well")
validate_schema(path=str(plate_zarr), type="plate")
check_file_number(zarr_path=image_zarr_0)
check_file_number(zarr_path=image_zarr_1)
"""

0 comments on commit df7f62b

Please sign in to comment.