Skip to content

Commit

Permalink
Make objects for plate and well acquisitions (#59)
Browse files Browse the repository at this point in the history
Introduce high content screening plate data structures for Cell Voyager and Molecular Devices systems. The `ConvertToNGFFPlate` converter consumes these plates and writes out ome-zarr NGFF plates. The converter uses dask to stitch the well-images and supports re-chunking and binning.

---------
Co-authored-by: Jan Eglinger <jan.eglinger@fmi.ch>
Co-authored-by: Tim-Oliver Buchholz <tim-oliver.buchholz@fmi.ch>
  • Loading branch information
imagejan authored Dec 13, 2023
1 parent 7fdc82c commit 993ab79
Show file tree
Hide file tree
Showing 61 changed files with 3,822 additions and 4,814 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
args: ["--profile", "black", --skip=__init__.py, --filter-files]
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
Expand Down
50 changes: 50 additions & 0 deletions examples/CellVoyagerStackAcquisitionExample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import shutil
from pathlib import Path

from faim_hcs.hcs.acquisition import TileAlignmentOptions
from faim_hcs.hcs.cellvoyager import StackAcquisition
from faim_hcs.hcs.converter import ConvertToNGFFPlate, NGFFPlate
from faim_hcs.hcs.plate import PlateLayout
from faim_hcs.stitching import stitching_utils


def main():
# Remove existing zarr.
shutil.rmtree("cv-stack.zarr", ignore_errors=True)

# Parse CV plate acquisition.
plate = StackAcquisition(
acquisition_dir=Path(__file__).parent.parent
/ "resources"
/ "CV8000"
/ "CV8000-Minimal-DataSet-2C-3W-4S-FP2-stack_20230918_135839"
/ "CV8000-Minimal-DataSet-2C-3W-4S-FP2-stack",
alignment=TileAlignmentOptions.GRID,
)

# Create converter.
converter = ConvertToNGFFPlate(
ngff_plate=NGFFPlate(
root_dir=".",
name="cv-stack",
layout=PlateLayout.I384,
order_name="order",
barcode="barcode",
),
yx_binning=2,
dask_chunk_size_factor=2,
warp_func=stitching_utils.translate_tiles_2d,
fuse_func=stitching_utils.fuse_mean,
)

# Run conversion.
converter.run(
plate_acquisition=plate,
well_sub_group="0",
chunks=(2, 1000, 1000),
max_layer=2,
)


if __name__ == "__main__":
main()
Loading

0 comments on commit 993ab79

Please sign in to comment.