Skip to content

load an image from lif file as a numpy array

License

Notifications You must be signed in to change notification settings

yangyushi/explore_lif

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

explore_lif

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

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 explore_lif in your project directory

How to Use It

For 3D Image

from explore_lif import Reader

reader = 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 (x, y, z)
image = chosen.getXYZ(T=0, channel=0)

For 2D Image with Multiple Channels

from explore_lif import Reader

reader = 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
# the shape is (x, y, channel_number)
image = chosen.getXYC(T=0)

About

load an image from lif file as a numpy array

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%