Exemple #1
0
def set_marks(datazip_filename,frame,mark_filename):
    from reader import Reader,ZipSource
    import matplotlib.pyplot as plt

    reader = Reader(ZipSource(datazip_filename))
    print reader
    reader.moveto(frame)
    bg = reader.getframe()
    fig = plt.figure()
    plt.imshow(bg)
    xy = plt.ginput(n=0)
    plt.close(fig)
    t = reader.head
    print xy,t
    fid = open(mark_filename,'w+t')
    for x,y in xy:
        fid.write('%f,%f,%d\n'%(x,y,t))
    del fid
    print 'marks saved in ',mark_filename
Exemple #2
0
    f2 = gaussian_filter(bg,sigma=15)

    f = ((f1-f2+3)*10).astype('uint8')

    loc_max = rankfilter(f,'highest',20,infSup=[0,0])

    r = bg.copy()
    r[loc_max>0]=0

    plt.figure()
    plt.subplot(2,2,1)
    plt.imshow(bg)
    plt.subplot(2,2,2)
    plt.imshow(f)
    plt.colorbar()
    plt.subplot(2,2,3)
    plt.imshow(loc_max)
    plt.subplot(2,2,4)
    plt.imshow(r)
    plt.show()

if __name__ == "__main__":

    datazip_filename = '../test/data/seq0_extract.zip'
    reader = Reader(ZipSource(datazip_filename))

    params = {'N':8,'radius_halo':22,'radius_soma':12,'exp_halo':20,'exp_soma':2,'niter':10,'alpha':.75}

#    plot_grid(reader.getframe(),model=Cell,params=params)
    preproc_dog(reader.moveto(29))