當前位置: 首頁>>代碼示例>>Python>>正文


Python ResultsTable.createTableFromImage方法代碼示例

本文整理匯總了Python中ij.measure.ResultsTable.createTableFromImage方法的典型用法代碼示例。如果您正苦於以下問題:Python ResultsTable.createTableFromImage方法的具體用法?Python ResultsTable.createTableFromImage怎麽用?Python ResultsTable.createTableFromImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ij.measure.ResultsTable的用法示例。


在下文中一共展示了ResultsTable.createTableFromImage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: anaParticles

# 需要導入模塊: from ij.measure import ResultsTable [as 別名]
# 或者: from ij.measure.ResultsTable import createTableFromImage [as 別名]
def anaParticles(imp, minSize, maxSize, minCirc, bHeadless=True):
  """anaParticles(imp, minSize, maxSize, minCirc, bHeadless=True)
  Analyze particles using a watershed separation. If headless=True, we cannot
  redirect the intensity measurement to the original immage becuae it is never
  displayed. If we display the original, we can and get the mean gray level. We
  may then compute the particle contrast from the measured Izero value for the image.
  No ability here to draw outlines on the original."""
  strName = imp.getShortTitle()
  imp.setTitle("original")
  ret = imp.duplicate()
  IJ.run(ret, "Enhance Contrast", "saturated=0.35")
  IJ.run(ret, "8-bit", "")
  IJ.run(ret, "Threshold", "method=Default white")
  IJ.run(ret, "Watershed", "")
  rt = ResultsTable()
  # strSetMeas = "area mean modal min center perimeter bounding fit shape feret's redirect='original' decimal=3"
  # N.B. redirect will not work without a displayed image, so we cannot use a gray level image
  if bHeadless == True:
    strSetMeas = "area mean modal min center perimeter bounding fit shape feret's decimal=3"
  else:
    imp.show()
    strSetMeas = "area mean modal min center perimeter bounding fit shape feret's redirect='original' decimal=3"
  IJ.run("Set Measurements...", strSetMeas)
  # note this doies not get passed directly to ParticleAnalyzer, so
  # I did this, saved everything and looked for the measurement value in ~/Library/Preferences/IJ_Prefs.txt
  # measurements=27355
  # meas = Measurements.AREA + Measurements.CIRCULARITY + Measurements.PERIMETER + Measurements.SHAPE_DESCRIPTORS
  # didn't work reliably
  meas = 27355
  pa = ParticleAnalyzer(0, meas, rt, minSize, maxSize, minCirc, 1.0);
  pa.analyze(ret);
  rt.createTableFromImage(ret.getProcessor())
  return [ret, rt]
開發者ID:jrminter,項目名稱:OSImageAnalysis,代碼行數:35,代碼來源:testAnaParticles.py

示例2: anaParticles

# 需要導入模塊: from ij.measure import ResultsTable [as 別名]
# 或者: from ij.measure.ResultsTable import createTableFromImage [as 別名]
def anaParticles(imp, minSize, maxSize, minCirc):
  strName = imp.getShortTitle()
  imp.setTitle("original")
  ret = imp.duplicate()
  IJ.run(ret, "Enhance Contrast", "saturated=0.35")
  IJ.run(ret, "8-bit", "")
  IJ.run(ret, "Threshold", "method=Default white")
  IJ.run(ret, "Watershed", "")
  rt = ResultsTable()
  # strSetMeas = "area mean modal min center perimeter bounding fit shape feret's redirect='original' decimal=3"
  # N.B. redirect will not work without a displayed image, so we cannot use a gray level image
  strSetMeas = "area mean modal min center perimeter bounding fit shape feret's decimal=3"
  IJ.run("Set Measurements...", strSetMeas)
  # note this doies not get passed directly to ParticleAnalyzer, so
  # I did this, saved everything and looked for the measurement value in ~/Library/Preferences/IJ_Prefs.txt
  # measurements=27355
  # meas = Measurements.AREA + Measurements.CIRCULARITY + Measurements.PERIMETER + Measurements.SHAPE_DESCRIPTORS
  # didn't work reliably
  meas = 27355
  pa = ParticleAnalyzer(0, meas, rt, minSize, maxSize, minCirc, 1.0);
  pa.analyze(ret);
  rt.createTableFromImage(ret.getProcessor())
  return [ret, rt]
開發者ID:jrminter,項目名稱:OSImageAnalysis,代碼行數:25,代碼來源:testHeadlessParticleAnalysis.py


注:本文中的ij.measure.ResultsTable.createTableFromImage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。