IJ.log('Linking ...') dlh = DLH(imp, 3, 10) # linkrange, distance #dlh.setData(ntd.getXcoordA(), ntd.getYcoordA(), ntd.getFrameA()) dlh.setData(nodes) # a new way, 20130321 nearestneighbor = LinkCostsOnlyDistance() dlh.doLinking(nearestneighbor, False) # convert to Tracks object vttt = VecTrajectoryToTracks() #vttt.run(dlh.getAll_traj()) vttt.run(dlh.getAll_traj(), nodes) tracks = vttt.getTracks() print "tracks", str(tracks.size()) for t in tracks.values(): #print t.getTrackID(), t.getNodes().get(0).getX(), t.getNodes().size(), t.getFrameStart() print t.getNodes().get(0).getOrgroi() 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, imp) vd.trackAllPlotter(tracks, imp) #vd.trackGapLinkPlotter(tracks, imp)
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)