Converter from the Lif files (Leica Microscope) to OME-Zarr format.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fractal_lif_converters-0.3.1.tar.gz.
File metadata
- Download URL: fractal_lif_converters-0.3.1.tar.gz
- Upload date:
- Size: 4.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 |
6eabd004a06d45091c20abc46631d3bf45db03e587afffacd70748d03ce789fc
|
|
| MD5 |
e9e6defcc02279f195899e2efb497543
|
|
| BLAKE2b-256 |
fd8aea2d786f66bbe380bdc09b1716a81bbfca31cc979d584f8ab4f320268b56
|
Provenance
The following attestation bundles were made for fractal_lif_converters-0.3.1.tar.gz:
Publisher:
build_and_test.yml on fractal-analytics-platform/fractal-lif-converters
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fractal_lif_converters-0.3.1.tar.gz -
Subject digest:
6eabd004a06d45091c20abc46631d3bf45db03e587afffacd70748d03ce789fc - Sigstore transparency entry: 153795432
- Sigstore integration time:
-
Permalink:
fractal-analytics-platform/fractal-lif-converters@e6e7be24b8aa6b7d3e5c51c1cdcd12e3cb155b29 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/fractal-analytics-platform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_and_test.yml@e6e7be24b8aa6b7d3e5c51c1cdcd12e3cb155b29 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fractal_lif_converters-0.3.1-py3-none-any.whl.
File metadata
- Download URL: fractal_lif_converters-0.3.1-py3-none-any.whl
- Upload date:
- Size: 31.2 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 |
2ebd19ad50be50bcd9d4a5363340697c8cbb69b11a71c70c7990d2a9b2fe70cd
|
|
| MD5 |
76597f47485063a80d4b81f0c0bd24b3
|
|
| BLAKE2b-256 |
e0c9c747b44fa0048abadadda53629ab45f594bc0c4418fb70f532664cf74464
|
Provenance
The following attestation bundles were made for fractal_lif_converters-0.3.1-py3-none-any.whl:
Publisher:
build_and_test.yml on fractal-analytics-platform/fractal-lif-converters
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fractal_lif_converters-0.3.1-py3-none-any.whl -
Subject digest:
2ebd19ad50be50bcd9d4a5363340697c8cbb69b11a71c70c7990d2a9b2fe70cd - Sigstore transparency entry: 153795434
- Sigstore integration time:
-
Permalink:
fractal-analytics-platform/fractal-lif-converters@e6e7be24b8aa6b7d3e5c51c1cdcd12e3cb155b29 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/fractal-analytics-platform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_and_test.yml@e6e7be24b8aa6b7d3e5c51c1cdcd12e3cb155b29 -
Trigger Event:
push
-
Statement type: