Ready to use test dataset

sktracker provides a data module contains sample dataset in order to test or usefulle during development.


In [ ]:
%matplotlib inline

In [39]:
import matplotlib.pyplot as plt

import pandas as pd

from sktracker import data
from sktracker.trajectories import Trajectories
from sktracker.io import TiffFile


2014-09-04 11:37:23:INFO:sktracker.utils.mpl_loader: Matplotlib backend 'Qt4Agg' has been loaded.

Generate brownian or directed trajectories


In [3]:
trajs = Trajectories(data.brownian_trajectories_generator())
trajs.show(groupby_args={'by': 'true_label'})


Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x2b946b1c1630>

In [4]:
trajs = Trajectories(data.directed_trajectories_generator())
trajs.show(groupby_args={'by': 'true_label'})


Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x2b946b19bfd0>

Get sample microscopy stack


In [5]:
tf = TiffFile(data.CZT_peaks())
arr = tf.asarray()
print("Shape is :", arr.shape)

a = arr[0, 0, 0]
plt.imshow(a, interpolation='none', cmap='gray')


Shape is : (1, 4, 4, 48, 56)
Out[5]:
<matplotlib.image.AxesImage at 0x2b946b360f60>

Get sample H5 file stored by sktacker.io.ObjectsIO


In [44]:
df = pd.HDFStore(data.sample_h5())
print(df.keys())
print(df['metadata'])


['/metadata', '/objects']
SizeT                             5
TimeIncrement                     3
DimensionOrder                 TZYX
Type                        unint16
PysicalSizeX                   0.43
PysicalSizeY                   0.43
PysicalSizeZ                    1.5
SizeX                           512
SizeY                           512
SizeZ                            23
FileName             sample.ome.tif
Shape             (512, 512, 23, 5)
dtype: object

See also :

- `sample_ome()`
- `tubhiswt_4D()`
- `stack_list_dir()`
- `TZ_nucleus`
- `TC_BF_cells()`
- `metadata_json()`
- `sample_h5_temp()`
- `brownian_trajs_df()`
- `directed_motion_trajs_df()`
- `trackmate_xml_temp()`
- `trackmate_xml()`
- `with_gaps_d()`

available in the API references.


In [ ]:
# Run this cell first.
%load_ext autoreload
%autoreload 2