noduleCADEvaluationLUNA16.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:cancer 作者: yancz1989 项目源码 文件源码
def computeFROC(FROCGTList, FROCProbList, totalNumberOfImages, excludeList):
  # Remove excluded candidates
  FROCGTList_local = []
  FROCProbList_local = []
  for i in range(len(excludeList)):
    if excludeList[i] == False:
      FROCGTList_local.append(FROCGTList[i])
      FROCProbList_local.append(FROCProbList[i])

  numberOfDetectedLesions = sum(FROCGTList_local)
  totalNumberOfLesions = sum(FROCGTList)
  totalNumberOfCandidates = len(FROCProbList_local)
  fpr, tpr, thresholds = skl_metrics.roc_curve(FROCGTList_local, FROCProbList_local)
  if sum(FROCGTList) == len(FROCGTList): # Handle border case when there are no false positives and ROC analysis give nan values.
    print "WARNING, this system has no false positives.."
    fps = np.zeros(len(fpr))
  else:
    fps = fpr * (totalNumberOfCandidates - numberOfDetectedLesions) / totalNumberOfImages
  sens = (tpr * numberOfDetectedLesions) / totalNumberOfLesions
  return fps, sens, thresholds
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号