Python을 활용한 생의학 영상 분석
Stephen Bailey
Instructor
박출률: 심장 좌심실(LV)에서 박출되는 혈액의 비율.



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()

이미지에서 단일 레이블 선택:
np.where(labels == 1, im, 0)
이미지에서 여러 레이블 선택:
np.where(labels < 3, im, 0)
경계 상자: 객체를 완전히 둘러싸는 픽셀 범위
ndi.find_objects()는 경계 상자 좌표 목록을 반환합니다

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

Python을 활용한 생의학 영상 분석