fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Update tasks to support Fractal V2 #669

Closed jluethi closed 2 months ago

jluethi commented 3 months ago

Update input API & output handling for:

Simple updates:

Refactoring required

Update Manifest

Testing

Future goals

jluethi commented 3 months ago

I'm doing some refactoring work on the Create OME-Zarr & Yokogawa to OME-Zarr handling. At first, I thought I could just pass the patterns list between the two functions. But the regex for finding individual channels could in some cases break in that approach. Thus, I've now set up an init_args model like this one:

class InitArgsCellVoyager(BaseModel):
    """
    Arguments to be passed from cellvoyager converter init to compute

    Attributes:
        image_dir: Directory where the raw images are found
        plate_prefix: part of the image filename needed for finding the 
            right subset of image files
        well_ID: part of the image filename needed for finding the 
            right subset of image files
        image_extension: part of the image filename needed for finding the 
            right subset of image files
        image_glob_patterns: Additional glob patterns to filter the available 
            images with
        acquisition: Acquisition metadata needed for multiplexing
    """

    image_dir: str
    plate_prefix: str
    well_ID: str
    image_extension: str
    image_glob_patterns: Optional[list[str]]
    acquisition: Optional[int]

And pattern parsing like this:

        patterns = [
            f"{init_args.plate_prefix}_{init_args.well_ID}_*{A}*{C}*."
            f"{init_args.image_extension}"
        ]
        if init_args.image_glob_patterns:
            patterns.extend(init_args.image_glob_patterns)