def test_annotate(): """Open the first frame of a sequence and wait the user click on initial cell position returns a list of positions """ datazip_filename = '../test/data/seq0_extract.zip' reader = Reader(ZipSource(datazip_filename)) ima = reader.moveto(29) fig = plt.figure(1) ax = fig.add_subplot(111) plt.imshow(ima) print '*'*80 print 'left-click : add , right-click : remove last, middle-click : exit' print '*'*80 xy = plt.ginput(n=0, timeout=0) print xy params = {'N':16,'radius_halo':30,'radius_soma':15} cell_list = [ Cell(x0,y0,**params) for x0,y0 in xy ] for c in cell_list: c.update(ima) CellUi(c,ax).draw(ax) plt.show()
# -*- coding: utf-8 -*- # display a sample cell import matplotlib.pyplot as plt import numpy as npy import context from ivctrack.reader import ZipSource,Reader datazip = '../../test/data/seq0_extract.zip' reader = Reader(ZipSource(datazip)) ima = reader.getframe() plt.figure() plt.imshow(ima[400:490,170:230],cmap=plt.cm.gray) plt.colorbar() plt.show()