MathieuLeocmach / read_lif

load an image from lif file as a numpy array

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

read_lif

Load 3D confocal images from lif files as numpy arrays.

The code was originally written by Mathieu Leocmach in package colloids.

Install

  • The most convenient way would be: pip install -e . from the directory where you have cloned or downloaded the code.
  • You can also Include the file read_lif in your project directory

How to Use It

import read_lif

reader = read_lif.Reader('lif_file.lif')
series = reader.getSeries()
chosen = series[0]  # choose first image in the lif file
# get a numpy array corresponding to the 1st time point & 1st channel
# the shape is (z, y, x)
image = chosen.getFrame(T=0, channel=0)

Version Issue

The current code (version >= 3.1) returns the data in the order of Z-Y-X. (ce240f6)

This is DIFFERENT from previous version, where the data is returned as X-Y-Z

About

load an image from lif file as a numpy array

License:GNU General Public License v3.0


Languages

Language:Python 99.8%Language:Shell 0.2%