Exemplo n.º 1
0
    for i in range(len(xpA)):
        # frame number starts from 1
        fulltA.append(j+1)

    # from here is just to test. 
    pointlist = []
    for i in range(len(xpA)):
        pointlist.append(Point(i, xpA[i], ypA[i], j))
        #pointlist.append(Nuc2D(xpA[i], ypA[i], j, i))
    if j < 4:
        print str(j), len(pointlist)
    #print pointlist[3].x
    frames.append(pointlist)

IJ.log('test ')
dlh = DLH(imp, 2, 15) # linkrange, distance
# becareful with the swapped X and Y axis
dlh.setData(jarray.array(fullxA, 'i'), jarray.array(fullyA, 'i'),  jarray.array(fulltA, 'i'))
nearestneighbor = LinkCostsOnlyDistance()
dlh.doLinking(nearestneighbor, False)
# convert to Tracks object
tracks = VecTrajectoryToTracks().runsimple(dlh.getAll_traj())
tracks.accept(TrackReLinker())

# plotting part
vd = VD(imp)
img2path = '/Volumes/D/Julia20130201-/NucleusSegmentationStudy/20130312/out_bernsen45.tif'
outimp = IJ.openImage(img2path)
#vd.plotTracks(outimp)
vd.plotTracks(tracks, outimp)