I have a problem with the handling of ResultsTable for the measurements of different parameters in different channels. I have a timeframe stack composed of different channels. What I do is to extract the channel, segment the nuclei for one channel and measure their shape, then use the rois to measure the mean intensity in the other channel, so that to be able to to trace back for the same cell the intensity in the other channels and its dimensions.
The problem is that if I try to extract the result of the measured intensity for one channel, it writes the shape measurements, while another result table opens with the measurements I want. How can I refer to the new ResultTable?
Here is my function
def iterate(imp, path_cyan, path_venus, path_cherry): """Iterate through timeframes to process images""" mcherry = extractChannel(imp,2) venus = extractChannel(imp,3) mask_cyan = extractChannel(imp,4) BlurImage(mask_cyan, 2.0, 1.0) IJ.run(mask_cyan, "Subtract Background...", "rolling=30 sliding stack") IJ.run(mask_cyan,"Convert to Mask", "method=Li background=Dark calculate") IJ.run(mask_cyan, "Watershed", "stack") rm = RoiManager().getInstance() #select the roi table, p = segmentParameters(mask_cyan) for i in range(mask_cyan.getStackSize()): mask_cyan.setSliceWithoutUpdate(i + 1) if p.analyze(mask_cyan): print "All ok: "+ str(i+1) else: print "There was a problem in analyzing", mask_cyan for roi in range(0, rm.getCount()): rm.select(roi) result = "Frame: "+str(i+1)+"\t"+table.getRowAsString(roi)+"\n" path_cyan.write(result) #table.reset() mcherry.setSliceWithoutUpdate(i + 1) mcherry.show() for roi in range(0, rm.getCount()): rm.select(roi) rm.runCommand("Measure") result = table.getRowAsString(roi)+"\n" path_cherry.write(result) venus.setSliceWithoutUpdate(i + 1) venus.show() for roi in range(0, rm.getCount()): rm.select(roi) rm.translate(-5,5) rm.runCommand("Measure") result = table.getRowAsString(roi)+"\n" path_venus.write(result) #problema:table refers to the rt where I have cyan´s results. How can I refer it to the new rt? rm.runCommand("Select All"); rm.runCommand("Delete")
I am writing in Jython, so I would really appreciate a help in this programming language