Commit 0f61c42a authored by Chris Evenhuis's avatar Chris Evenhuis
Browse files

remove class files, update calibration for imp_map

parent 007e99c8
......@@ -196,7 +196,7 @@ def main():
root = os.path.splitext(filename)[0]
rt_results.save(dirname+"/"+root+"_res.csv")
print("saved results")
depthStats.add_depth_stats(name,ip_map,ip_lab,rt_depth)
depthStats.add_depth_stats(name,imp_map,ip_lab,rt_depth)
rt_depth.show("Depth")
ImagePlus("lab",ip_lab).show()
......
......@@ -5,15 +5,18 @@ sys.path.insert(0,"/Users/evenhuis/Dropbox/MIF/Workflows/biofilm_map/biofilm_map
def add_depth_stats( filename, imp_map, ip_lab, rt_depth,\
showSplit=False ):
from ij import ImagePlus
from ij.process import ImageStatistics
from ij.plugin.filter import ThresholdToSelection
t2s = ThresholdToSelection()
imstats = ImageStatistics()
ip_map = imp_map.getProcessor()
cal = imp_map.getCalibration()
ic = rt_depth.getCounter()
ip_map.setRoi(None)
stats = ip_map.getStatistics()
stats = imstats.getStatistics(ip_map,imstats.ALL_STATS, cal )
hist_tot = stats.getHistogram()
rt_depth.setValue("file",ic,filename)
print(stats.area,stats.mean,stats.stdDev)
......@@ -28,7 +31,7 @@ def add_depth_stats( filename, imp_map, ip_lab, rt_depth,\
roi_part = t2s.convert(ip_lab)
ip_map.setRoi(roi_back)
stats = ip_map.getStatistics()
stats = imstats.getStatistics(ip_map,imstats.ALL_STATS, cal )
hist_back = stats.getHistogram()
rt_depth.setValue("back_area", ic,stats.area)
rt_depth.setValue("back_mean", ic,stats.mean)
......@@ -52,7 +55,7 @@ def add_depth_stats( filename, imp_map, ip_lab, rt_depth,\
ip_map.setRoi(roi_part)
stats = ip_map.getStatistics()
stats = imstats.getStatistics(ip_map,imstats.ALL_STATS, cal )
hist_roi = stats.getHistogram()
rt_depth.setValue("roi_area", ic,stats.area)
rt_depth.setValue("roi_mean", ic,stats.mean)
......
......@@ -178,7 +178,7 @@ def main():
rt_results,roim_p,ip_lab = get_nAg_results_and_roim(imp_nag,thresh=1800)
rt_results,roim_p,ip_lab = get_nAg_results_and_roim(imp_nag,thresh=None)
rt_results.show("Results")
from ij.plugin.frame import RoiManager
roim = RoiManager.getInstance() or RoiManager()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment