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


Python ResultsTable.getValueAsDouble方法代碼示例

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


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

示例1: ResultsTable

# 需要導入模塊: from ij.measure import ResultsTable [as 別名]
# 或者: from ij.measure.ResultsTable import getValueAsDouble [as 別名]
### Compute area fraction of oriented regions ###
# Compute area of oriented mask
newMaskImp = ImageJFunctions.wrapUnsignedByte(newMask, "New mask");
newMaskImp.getProcessor().setThreshold(1.0, 1.5, False); # [0.5, 1.0] does not work due to rounding problems
rt = ResultsTable();
analyzer = Analyzer(newMaskImp, Measurements.AREA | Measurements.LIMIT, rt);
analyzer.measure();

# Compute area of overall selection mask 
energyMaskImp = ImageJFunctions.wrapUnsignedByte(overallSelectionMask, "Energy mask");
energyMaskImp.getProcessor().setThreshold(1.0, 1.5, False); # [0.5, 1.0] does not work due to rounding problems
rtEnergy = ResultsTable();
analyzerEnergy = Analyzer(energyMaskImp, Measurements.AREA | Measurements.LIMIT, rtEnergy);
analyzerEnergy.measure();

# Print Area% (through SciJava OUTPUT, see L5)
if IJ.debugMode:
  print("Coherency area: "+str(rt.getValueAsDouble(rt.getColumnIndex("Area"), rt.size()-1)));
  print("Energy area: "+str(rtEnergy.getValueAsDouble(rtEnergy.getColumnIndex("Area"), rtEnergy.size()-1)));

areaCoherency = rt.getValueAsDouble(rt.getColumnIndex("Area"), rt.size()-1);
areaEnergy = rtEnergy.getValueAsDouble(rtEnergy.getColumnIndex("Area"), rtEnergy.size()-1);
areaFraction = str(areaCoherency/areaEnergy*100.0)+"%";

# Close "S-Mask"
if not IJ.debugMode:
  maskImp.close();
# Close "Energy"
if not IJ.debugMode and useEnergy:
  energyImp.close();
開發者ID:bic-kn,項目名稱:ParticleOrientationAnalysis,代碼行數:32,代碼來源:Particle_Orientation_Analysis.py


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