分开绘制直方图
较差的组织分割会把多种组织混在一起,导致像素强度值分布很宽,方差更大。
相反,若左心室被完美分割,则只包含与血液相关的像素,因此分割后像素值的直方图应大致呈钟形分布。
在本练习中,请比较 vol 中所列像素集合的强度分布。使用 ndi.histogram,该函数也接受 labels 和 index 参数。
本练习是课程的一部分
Python 中的生物医学图像分析
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Create histograms for selected pixels
hist1 = ndi.histogram(vol, min=0, max=255, bins=256)
hist2 = ndi.histogram(vol, 0, 255, 256, labels=____)
hist3 = ndi.histogram(vol, 0, 255, 256, labels=____, index=____)