Quantifying wound healing/cell migration in 3D

Timo Friedrich and Jan Kaslin showed me some 3D fluorescent labelled cells invading a wound that they would like to quantify. Initially, quantification along a single axis is acceptable. Let's load a sample dataset:


In [1]:
%matplotlib inline
import os
import numpy as np
from matplotlib import pyplot as plt

datadir = '/Users/nuneziglesiasj/Data/zebrafish-lesion'
os.chdir(datadir)

In [2]:
from gala import imio
im = imio.read_image_stack('sci-quant.tif')
im.shape, im.dtype, im.min(), im.max()


WARNING:root: progressbar package not installed. Progress cannot be shown. See http://pypi.python.org/simple/progressbar or type "sudo easy_install progressbar" to fix.
pylibtiff not available: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pylibtiff
Out[2]:
((512, 512, 1872), dtype('int64'), 0, 255)

That took way too long. Additionally, the volume is the wrong shape! I'm going to save the image as an hdf5 file and comment out the above lines.


In [4]:
im8 = np.ascontiguousarray(im.astype(np.uint8).transpose((2, 0, 1)).reshape(104, 18, 512, 512))


Out[4]:
<matplotlib.image.AxesImage at 0x102c4af90>

In [5]:
plt.imshow(im8[0, 7, ...])


Out[5]:
<matplotlib.image.AxesImage at 0x102c7cd90>

In [7]:
imio.write_h5_stack(im8, 'sci-quant.lzf.h5', compression='lzf')

The compression has worked really well (3x size reduction)! We start over with the right file format.