Example #1
0
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()
    #print "x", ns.get(i).getOrgroi().getBounds().x, "y", ns.get(i).getOrgroi().getBounds().y
    #print "w", ns.get(i).getOrgroi().getBounds().width, "h", ns.get(i).getOrgroi().getBounds().height