Ejemplo n.º 1
0
'''

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())
Ejemplo n.º 2
0
from emblcmci.linker.costfunctions import LinkCostsOnlyDistance
from emblcmci.linker import ViewDynamics as VD
from de.embl.cmci.obj.converters import VecTrajectoryToTracks
from de.embl.cmci.seg import NucleusExtractor 
import jarray
'''
a test code for preprocessing nucleus image to derive maxima
and then get track
'''

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'
imp = IJ.openImage(imgpath)

ntd = NucToDots(imp);
#ntd.run()
imp2 = ntd.preprocessCoreStack(imp) # for imp that is already stackCLAHEed.
#for i in ntd.getXcoordA():
#        print i

imp2.show()

print "Extracting Nucleus ..."
#subwwhh = 110  # this must be guessed in the pre-run, by doing particle analysis and get the approximate sizes. 
en = NucleusExtractor(imp)
#en.constructNodesByPA(imp2)
ns = en.getPerNucleusBinImgProcessors(imp, imp2)

# for i in range(10):
#     ImagePlus(str(i), ns.get(i).getBinip()).show()
Ejemplo n.º 3
0
and then get track
... 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()) 
Ejemplo n.º 4
0
'''

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()

subwwhh = 120 # size of sub image
# from here is the extraction
'''
nrp = NRP()
nrp.getPerNucleusBinImgProcessors(imp, subwwhh, ntd.getXcoordA(), ntd.getYcoordA(), ntd.getFrameA())
stk = nrp.getBinStack();
'''

en = NucleusExtractor(imp, ntd.getXcoordA(), ntd.getYcoordA(), ntd.getFrameA())
en.constructNodes(subwwhh)
en.analyzeDotsandBinImages()
nodes = en.getNodes()
stk = ImageStack(subwwhh, subwwhh)