Package description.
Project description
Lif to OME-Zarr Converters
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
Built Distribution
File details
Details for the file fractal_lif_converters-3.0.3.tar.gz
.
File metadata
- Download URL: fractal_lif_converters-3.0.3.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e689ae09cbad800cc429849dd449b8bf1a49e029a3370354b52789730dc6ea3 |
|
MD5 | f2c2a00fc7685c771cd8f9acb699425e |
|
BLAKE2b-256 | a366465b3ad9b6ddef5dce681dc37d3be4c4b738a38d07e6a8b32ee73713750a |
File details
Details for the file fractal_lif_converters-3.0.3-py3-none-any.whl
.
File metadata
- Download URL: fractal_lif_converters-3.0.3-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f77d1061b1dff7af4440f948451936446dab464f57774f40fe81a9828dcd2052 |
|
MD5 | 43b16b3323a62d71a7e4a8df95a9e8c4 |
|
BLAKE2b-256 | c55b92a6bf5b7efd3b1b38aba7238628b536543ce6a54b6557184a8d1958d683 |