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-0.2.12.tar.gz
.
File metadata
- Download URL: fractal_lif_converters-0.2.12.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b427e5917f9be59d46675fe4492a16bf314c933feb3dc7aa857425d71dbb02 |
|
MD5 | ac19a7777871eb9ad64f7e604d0fe690 |
|
BLAKE2b-256 | 351f9cc8f65e3d6411d918eb0ee2d0746599a70a14ebdf301b3bb30737401009 |
File details
Details for the file fractal_lif_converters-0.2.12-py3-none-any.whl
.
File metadata
- Download URL: fractal_lif_converters-0.2.12-py3-none-any.whl
- Upload date:
- Size: 15.6 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 | 30041055a9bfd8c6065a972cdc97c8574aabb47ae8afe0e7cb0262489cf6db94 |
|
MD5 | 1a44574234772aa3e5058ade852714e9 |
|
BLAKE2b-256 | 9cf4381e1ca3914b163dc317ea6c4072c2b4d0863b0df94574b9c1a6ff3799ef |