Phân tích ảnh Y sinh học bằng Python
Stephen Bailey
Instructor
Phân suất tống máu: tỷ lệ máu được bơm ra khỏi thất trái (LV) của tim.



import scipy.ndimage as ndi im=imageio.imread('SCD4201-2d.dcm') filt=ndi.gaussian_filter(im, sigma=2) mask = filt > 150labels, nlabels = ndi.label(mask)
nlabels
14
plt.imshow(labels, cmap='rainbow')
plt.axis('off')
plt.show()

Chọn một nhãn trong ảnh:
np.where(labels == 1, im, 0)
Chọn nhiều nhãn trong ảnh:
np.where(labels < 3, im, 0)
Hộp bao: phạm vi pixel bao trọn một đối tượng
ndi.find_objects() trả về danh sách tọa độ hộp bao

labels, nlabels = ndi.label(mask) boxes = ndi.find_objects(labels)boxes[0]
(slice(116,139), slice(120, 141))

Phân tích ảnh Y sinh học bằng Python