Skip to main content

Package description.

Project description

Lif to OME-Zarr Converters

CI (build and test) codecov

This repository contains the code to convert Lif files to OME-Zarr format.

Installation

To install the package, run the following command:

pip install git+https://github.com/fractal-analytics-platform/fractal-lif-converters

Example usage

  • Plate Converter:
from pathlib import Path

from lif_converters.wrappers import convert_lif_plate_to_omezarr

zarr_dir = "./exports" # Directory path where the OME-Zarr file will be saved
lif_file_path = "./testData_Leica/" # File or directory path containing the lif files
n_levels = 5 # Number of levels to be created in the OME-Zarr file
coarsening_xy = 2 # Coarsening factor for the xy dimensions

convert_lif_plate_to_omezarr(
    zarr_dir=zarr_dir,
    lif_files_path=lif_file_path,
    num_levels=n_levels,
    coarsening_xy=coarsening_xy,
    overwrite=True,
    verbose=True,
)

Where the .lif file is formatted as follows:

/Project.lif
----/Tilescan 1/A/1
----/Tilescan 1/A/2
    ...
----/Tilescan 1/B/1
    ...
----/Tilescan 2/A/1

and the OME-Zarr file will be formatted as follows:

/Project.zarr
----/A
--------/1
------------/0 # This will correspond to "Tilescan 1/A/1"
------------/1 # This will correspond to "Tilescan 2
            ...
  • Single Acquisition Converter:
from pathlib import Path

from lif_converters.wrappers import convert_lif_scene_to_omezarr

zarr_dir = "./exports" # Directory path where the OME-Zarr file will be saved
lif_file_path = "./testData_Leica/" # File or directory path containing the lif files
scene_name = "Scene-1" # Name of the scene to be converted
n_levels = 5 # Number of levels to be created in the OME-Zarr file
coarsening_xy = 2 # Coarsening factor for the xy dimensions

convert_lif_plate_to_omezarr(
    zarr_dir=zarr_dir,
    lif_files_path=lif_file_path,
    num_levels=n_levels,
    scene_name=scene_name,
    coarsening_xy=coarsening_xy,
    overwrite=True,
    verbose=True,
)

Note that the if the scene_name is not provided, all the scenes in the lif file will be converted in a single Ngff Image.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fractal_lif_converters-0.2.13.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

fractal_lif_converters-0.2.13-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file fractal_lif_converters-0.2.13.tar.gz.

File metadata

File hashes

Hashes for fractal_lif_converters-0.2.13.tar.gz
Algorithm Hash digest
SHA256 0ecf85beda9a968efd4db71ee2fcd7dacbebf6632d20fd488fb0a87750668b55
MD5 103125eb9519a242520794ce27994b0b
BLAKE2b-256 62718931a7af2334fe23787022ccf18eebff804b90559c0b23081f3e7e4f253e

See more details on using hashes here.

File details

Details for the file fractal_lif_converters-0.2.13-py3-none-any.whl.

File metadata

File hashes

Hashes for fractal_lif_converters-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 dbac3f0aeee06e790c5acd11d0ed29d90377da2cf54a1f8fbb30e97bf0da7e2b
MD5 753b757ff65ec5391c2594366986ab2b
BLAKE2b-256 dc6b6f7bcc0af1a776adb5250fe3af4060bc3b3f0dcb9dc35c775aa9b65f1af1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page