예제 #1
0
#ppimp =ntd.preprocess(imp) 
#ppimp.show()

#maximp = NucToDots(imp).run()
#maximp.show()

ntd = NucToDots(imp);
ntd.run()
for i in ntd.getXcoordA():
        print i
        
IJ.log('test ')
dlh = DLH(imp, 2, 15) # linkrange, distance
# becareful with the swapped X and Y axis
#dlh.setData(jarray.array(ntd.getXcoords(), 'i'), jarray.array(ntd.getYcoords(), 'i'),  jarray.array(ntd.getFrame(), 'i'))
dlh.setData(ntd.getXcoordA(), ntd.getYcoordA(),  ntd.getFrameA())
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, imp)
vd.trackAllPlotter(tracks, imp)
#vd.trackGapLinkPlotter(tracks, imp)
예제 #2
0
#imgpath = '/Volumes/D/Julia20130201-/almfscreen/samples_112712/l3/l3c1.tif'
#imgpath = '/Volumes/D/Julia20130201-/almfscreen/samples_112712/l4/l4c1.tif'
imgpath = '/Volumes/D/Julia20130201-/almfscreen/samples_112712/l5/l5c1.tif'

imp = IJ.openImage(imgpath)
ntd = NucToDots(imp);
ntd.run() # runs CLAHE first, takes a bit of time. 
#ntd.runmain() # for imp that is already stackCLAHEed.
#for i in ntd.getXcoordA():
#        print i


print "Extracting Nucleus ..."
subwwhh = 130  # this must be guessed in the pre-run, by doing particle analysis and get the approximate sizes. 
WATERSHED_THRESHOLD = 0.10;
en = NucleusExtractor(imp, ntd.getXcoordA(), ntd.getYcoordA(), ntd.getFrameA())
en.constructNodesByDots(subwwhh, WATERSHED_THRESHOLD)
print 'node length before filtering: ' + str(en.getNodes().size()) 
en.analyzeDotsandBinImages()
print 'node length after filtering: ' + str(en.getNodes().size()) 

nodes = en.getNodes()


'''
stk = ImageStack(subwwhh, subwwhh)
for n in nodes:
    binip = n.getBinip()
    stk.addSlice(binip)
ImagePlus("tt", stk).show()
'''