分開繪製長條圖
糟糕的組織分割會把多種組織混在一起,造成亮度值分佈很寬、變異更大。
相對地,若能完美分割出左心室,理論上只會包含與血液相關的像素,因此分割後的亮度長條圖應該近似鐘形分佈。
在這個練習中,請比較 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=____)