# Reading Leica .lif files in julia

**URL:** <https://discourse.julialang.org/t/reading-leica-lif-files-in-julia/87924>\
**Category:** Biology, Health, and Medicine\
**Tags:** question\
**Created:** [September 28, 2022, 11:56am UTC](https://discourse.julialang.org/t/reading-leica-lif-files-in-julia/87924 "2022-09-28T11:56:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pascal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pascal/32/207922_2.png) [@pascal](https://discourse.julialang.org/u/pascal)\
**Post date:** [September 28, 2022, 11:56am UTC](https://discourse.julialang.org/t/reading-leica-lif-files-in-julia/87924/1 "2022-09-28T11:56:52Z")

</div>

Is there way how I can read in `.lif` files that are generated by [Leica microscopes](https://docs.openmicroscopy.org/bio-formats/5.8.2/formats/leica-lif.html)?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 29, 2022, 8:56am UTC](https://discourse.julialang.org/t/reading-leica-lif-files-in-julia/87924/2 "2022-09-29T08:56:38Z")

</div>

I doubts there’s a specific Julia package, I searched and couldn’t find it.

But you can call Python (or e.g. Java), and they have libraries to read the files.

There’s nothing wrong to use Python with Julia, like in this case, and I would recommend with PythonCall.jl (likely ideal, more so than with JavaCall.jl):

> **[readlif](https://pypi.org/project/readlif/)**
>
> Fast Leica LIF file reader written in python

[https://docs.openmicroscopy.org/bio-formats/6.9.0/formats/leica-lif.html](https://docs.openmicroscopy.org/bio-formats/6.9.0/formats/leica-lif.html)

If you get it to work (and find it non-ideal), or not, then we can look a better solution. And if you get it to work, you can make a simple Julia wrapper for Python’s readlif. Likely it wraps C code, wrapping it directly would also be a possibility, and whatever works, the wrapper could be changed to pure Julia code if needed later (and that would likely be never).
