How the data looks like and is being used


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

In [2]:
import neuralyzer
from neuralyzer.im import smff

In [4]:
plt.rcParams['image.cmap'] = 'gray'
plt.rcParams['image.interpolation'] = 'none'
plt.rcParams['figure.figsize'] = (8,8)

In [3]:
#datafile = '/Users/michael/coding/RIKEN/data/140316/data5/data2/Image_0001_0001_channel0_13000_14000.tif'
#datafile = '/home/michael/datac/140316/data5/data2/Image_0001_0001_channel0.tif'
datafile = '/home/michael/datac/140316/data5/data2/Image_0001_0001_channel1_testdata.tif'
data = neuralyzer.get_data(datafile)


[ 2015-04-17 15:31:09 ] [ log ] [ INFO ] : NEURALYZER LOGGER CREATED
[ 2015-04-17 15:31:09 ] [ log ] [ DEBUG ] : stdoutloglevel: DEBUG
[ 2015-04-17 15:31:09 ] [ data_handler ] [ DEBUG ] : root_path set to /home/michael/lib/neuralyzer/notebooks/dev
[ 2015-04-17 15:31:09 ] [ data_handler ] [ DEBUG ] : loaded data from cache file: /home/michael/datac/140316/data5/data2/Image_0001_0001_channel1_testdata.tif.hdf5

In [5]:
print data.dtype
print data.shape
print data[0].shape


uint16
(1000, 256, 256)
(256, 256)

Mean Image and how the axis lay

In the numpy array data the axis are as follows:

data[time, y, x]

therefore, to get the image at time t i can simply do:

data[t]


In [6]:
mean = data.mean(axis=0)
# creating a white stripe of 20 pixels width along the first axis!!
mean[:,:20] = mean.max()
plt.imshow(mean)


Out[6]:
<matplotlib.image.AxesImage at 0x43895d0>

Data Usage


In [8]:
datashape = data.shape
data = data.reshape((data.shape[0], data.shape[1]*data.shape[2])).T
data.shape


Out[8]:
(65536, 1000)

In [10]:
# image at timepoint 0
plt.imshow(data[:,0].reshape((256, 256)))


Out[10]:
<matplotlib.image.AxesImage at 0x47afb90>

In [ ]: