【SimpleITK】分割结果融合策略

前言

有时我们会有多个专家标注的结果或者是多个模型得到的结果,对所有的结果做一个融合,目前有两种主流做法:

  • 投票法 (majority vote)
  • STAPLE (Simultaneous Truth and Performance Level Estimation)

对多个专家的标注结果进行融合之后,我们得到的标注就可以作为ground truth参与到模型的分割训练;当然,对多模型的结果进行融合,同样可以得到更加鲁棒的结果。
此处针对的场景是医疗影像,所以我们使用SimpleITK相应的API来实现结果融合的功能。官方notebook可以参考:http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/34_Segmentation_Evaluation.html

样例数据

数据

import SimpleITK as sitk
import numpy as np
import matplotlib.pyplot as plt
image = sitk.ReadImage("../Data/liverTumorSegmentations/Patient01Homo.mha")

segmentation_file_names = ["../Data/liverTumorSegmentations/Patient01Homo_Rad01.mha", 
                          "../Data/liverTumorSegmentations/Patient01Homo_Rad02.mha",
                          "../Data/liverTumorSegmentations/Patient01Homo_Rad03.mha"]
                          
segmentations = [sitk.ReadImage(file_name, sitk.sitkUInt8) for file_name in segmentation_file_names]

样例数据中有3个不同的标注,打印如下:

fig, (ax1, ax2, ax3, ax4) = plt.subplots(1, 4, figsize = (20, 10))
ax1.imshow(sitk.GetArrayFromImage(image)[75], cmap=plt.cm.bone)
ax1.set_title('image')
ax2.imshow(sitk.GetArrayFromImage(segmentations[0])[75])
ax2.set_title('label 1')
ax3.imshow(sitk.GetArrayFromImage(segmentations[1])[75])
ax3.set_title('label 2')
ax4.imshow(sitk.GetArrayFromImage(segmentations[2])[75])
ax4.set_title('label 3')

一幅图像,3个标注:
在这里插入图片描述

投票法

Use majority voting to obtain the reference segmentation.

API

  • sitk.LabelVoting
help(sitk.LabelVoting)

Help on function LabelVoting in module SimpleITK.SimpleITK:
LabelVoting(*args)

  • LabelVoting(VectorOfImage images, uint64_t labelForUndecidedPixels) -> Image

投票法无法处理ties?

labelForUndecidedPixels = 10
reference_segmentation_majority_vote = sitk.LabelVoting(segmentations, labelForUndecidedPixels)    

manual_plus_majority_vote = list(segmentations)  
# Append the reference segmentation to the list of manual bsegmentations
manual_plus_majority_vote.append(reference_segmentation_majority_vote)

显示:
在这里插入图片描述

STAPLE algorithm

# Use the STAPLE algorithm to obtain the reference segmentation. This implementation of the original algorithm
# combines a single label from multiple segmentations, the label is user specified. The result of the
# filter is the voxel's probability of belonging to the foreground. We then have to threshold the result to obtain
# a reference binary segmentation.
foregroundValue = 1
threshold = 0.95
reference_segmentation_STAPLE_probabilities = sitk.STAPLE(segmentations, foregroundValue) 
# We use the overloaded operator to perform thresholding, another option is to use the BinaryThreshold function.
reference_segmentation_STAPLE = reference_segmentation_STAPLE_probabilities > threshold

manual_plus_staple = list(segmentations)  
# Append the reference segmentation to the list of manual segmentations
manual_plus_staple.append(reference_segmentation_STAPLE)

显示:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tpzugI51-1579146091814)(./1579145875162.png)]

对比

显示对比:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ospU2fwm-1579146091815)(./1579145982153.png)]

  • 8
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值