https://github.com/cgohlke/liffile

Read Leica image files (LIF, LOF, XLIF, XLCF, XLEF, and LIFEXT).

https://github.com/cgohlke/liffile

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords

flim fluorescence-lifetime-spectroscopy fluorescence-microscopy-imaging format-reader image leica life-sciences-image python
Last synced: 5 months ago · JSON representation

Repository

Read Leica image files (LIF, LOF, XLIF, XLCF, XLEF, and LIFEXT).

Basic Info
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 13
Topics
flim fluorescence-lifetime-spectroscopy fluorescence-microscopy-imaging format-reader image leica life-sciences-image python
Created about 1 year ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License

README.rst

..
  This file is generated by setup.py

Read Leica image files (LIF, LOF, XLIF, XLCF, XLEF, and LIFEXT)
===============================================================

Liffile is a Python library to read image and metadata from Leica image files:
LIF (Leica Image File), LOF (Leica Object File), XLIF (XML Image File),
XLCF (XML Collection File), XLEF (XML Experiment File), and LIFEXT (Leica
Image File Extension).

These files are written by LAS X software to store collections of images
and metadata from microscopy experiments.

:Author: `Christoph Gohlke `_
:License: BSD-3-Clause
:Version: 2025.5.10
:DOI: `10.5281/zenodo.14740657 `_

Quickstart
----------

Install the liffile package and all dependencies from the
`Python Package Index `_::

    python -m pip install -U liffile[all]

See `Examples`_ for using the programming interface.

Source code and support are available on
`GitHub `_.

Requirements
------------

This revision was tested with the following requirements and dependencies
(other versions may work):

- `CPython `_ 3.10.11, 3.11.9, 3.12.10, 3.13.3 64-bit
- `NumPy `_ 2.2.5
- `Imagecodecs `_ 2025.3.30
  (required for decoding TIFF, JPEG, PNG, and BMP)
- `Xarray `_ 2025.4.0 (recommended)
- `Matplotlib `_ 3.10.3 (optional)
- `Tifffile `_ 2025.5.10 (optional)

Revisions
---------

2025.5.10

- Support Python 3.14.

2025.4.12

- Improve case_sensitive_path function.

2025.3.8

- Support LOF files without LMSDataContainerHeader XML element.

2025.3.6

- Support stride-aligned RGB images.

2025.2.20

- Rename LifFileFormat to LifFileType (breaking).
- Rename LifFile.format to LifFile.type (breaking).

2025.2.10

- Support case-sensitive file systems.
- Support OMETiffBlock, AiviaTiffBlock, and other memory blocks.
- Remove LifImageSeries.items and paths methods (breaking).
- Deprecate LifImage.xml_element_smd.
- Fix LifImage.parent_image and child_images properties for XML files.
- Work around reading float16 blocks from uint16 OME-TIFF files.

2025.2.8

- Support LIFEXT files.
- Remove asrgb parameter from LifImage.asarray (breaking).
- Do not apply BGR correction when using memory block frames.
- Avoid copying single frame to output array.
- Add LifImage.parent_image and child_images properties.
- Add LifImageSeries.find method.

2025.2.6

- Support XLEF and XLCF files.
- Rename LifFile.series property to images (breaking).
- Rename imread series argument to image (breaking).
- Remove LifImage.index property (breaking).
- Add parent and children properties to LifFile.
- Improve detection of XML codecs.
- Do not keep XML files open.

2025.2.5

- Support XLIF files.
- Revise LifMemoryBlock (breaking).
- Replace LifImage.is_lof property with format (breaking).
- Require imagecodecs for decoding TIF, JPEG, PNG, and BMP frames.

2025.2.2

- …

Refer to the CHANGES file for older revisions.

Notes
-----

`Leica Microsystems GmbH `_ is a manufacturer of
microscopes and scientific instruments for the analysis of micro and
nanostructures.

This library is in its early stages of development. It is not feature-complete.
Large, backwards-incompatible changes may occur between revisions.

Specifically, the following features are currently not supported:
XLLF formats, image mosaics and pyramids, partial image reads,
reading non-image data like FLIM/TCSPC, heterogeneous channel data types,
discontiguous storage, and bit increments.

The library has been tested with a limited number of version 2 files only.

The Leica image file formats are documented at:

- Leica Image File Formats - LIF, XLEF, XLLF, LOF. Version 3.2.
  Leica Microsystems GmbH. 21 September 2016.
- Annotations to Leica Image File Formats for LAS X Version 3.x. Version 1.4.
  Leica Microsystems GmbH. 24 August 2016.
- TSC SP8 FALCON File Format Description. LAS X Version 3.5.0.

Other implementations for reading Leica image files are
`readlif `_ and
`Bio-Formats `_ .

Examples
--------

Read a FLIM lifetime image and metadata from a LIF file:

.. code-block:: python

    >>> with LifFile('tests/data/FLIM.lif') as lif:
    ...     for image in lif.images:
    ...         name = image.name
    ...     image = lif.images['Fast Flim']
    ...     assert image.shape == (1024, 1024)
    ...     assert image.dims == ('Y', 'X')
    ...     lifetimes = image.asxarray()
    ...
    >>> lifetimes
     Size: 2MB
    array([[...]],
          shape=(1024, 1024), dtype=float16)
    Coordinates:
      * Y        (Y) float64... 0.0005564
      * X        (X) float64... 0.0005564
    Attributes...
        path:           FLIM_testdata.lif/sample1_slice1/FLIM Compressed/Fast Flim
        F16:            {'Name': 'F16',...
        TileScanInfo:   {'Tile': {'FieldX': 0,...
        ViewerScaling:  {'ChannelScalingInfo': {...

View the image and metadata in a LIF file from the console::

    $ python -m liffile tests/data/FLIM.lif

Owner

  • Name: Christoph Gohlke
  • Login: cgohlke
  • Kind: user
  • Location: Irvine, California

GitHub Events

Total
  • Release event: 14
  • Watch event: 2
  • Public event: 1
  • Push event: 15
  • Fork event: 2
  • Create event: 12
Last Year
  • Release event: 14
  • Watch event: 2
  • Public event: 1
  • Push event: 15
  • Fork event: 2
  • Create event: 12

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 76
  • Total Committers: 1
  • Avg Commits per committer: 76.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 76
  • Committers: 1
  • Avg Commits per committer: 76.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Christoph Gohlke c****e@c****m 76
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 1,970 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 16
  • Total maintainers: 1
pypi.org: lifffile

Lifffile is a placeholder for the liffile package.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 8 Last month
Rankings
Dependent packages count: 9.5%
Forks count: 24.4%
Average: 29.4%
Stargazers count: 30.2%
Dependent repos count: 53.3%
Maintainers (1)
Last synced: 6 months ago
pypi.org: liffile

Read Leica image files (LIF, LOF, XLIF, XLCF, XLEF, and LIFEXT)

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,962 Last month
Rankings
Dependent packages count: 9.7%
Average: 32.2%
Dependent repos count: 54.7%
Maintainers (1)
Last synced: 6 months ago
pypi.org: bioio-liffile

A bioio plugin for reading files via liffile

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.6%
Average: 38.8%
Dependent repos count: 68.0%
Maintainers (1)
Last synced: 8 months ago