imgpath = '/Users/miura/Dropbox/people/julia/NucSegmentStudy/l5c1_350_.tif' #imgpath = '/Users/miura/Dropbox/people/julia/NucSegmentStudy/L1CH2_maxp_300-374sampleframe.tif' imp = IJ.openImage(imgpath) #ntd = NucToDots(imp) #ntd.stackCLAHE(imp) #imp.show() #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
... mdofied for extracting positive class images and negative class images. ''' imgpath = '/Users/miura/Dropbox/people/julia/NucSegmentStudy/l5c1_350_CLAHE.tif' #imgpath = '/Users/miura/Dropbox/people/julia/NucSegmentStudy/L1CH2_maxp_300-374sampleframe.tif' #imgpath = '/Users/miura/Dropbox/people/julia/NucSegmentStudy/l5c1_CLAHE.tif' #imgpath = '/Users/miura/Dropbox/people/julia/NucSegmentStudy/l5c1_fastCLAHE.tif' #imgpath = '/Volumes/D/Julia20130201-/almfscreen/samples_112712/l1/CH2_maxp.tif' #imgpath = '/Volumes/D/Julia20130201-/almfscreen/samples_112712/l2/l2c1.tif' #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()