Python 中的生物医学图像分析
Stephen Bailey
Instructor
im[row, col]
vol[pln, row, col]

im[row, col, ch]

im_ts[time, row, col, ch]

import imageio.v2 as imageio import numpy as npim1=imageio.imread('chest-000.dcm') im2=imageio.imread('chest-001.dcm') im3=imageio.imread('chest-002.dcm')im1.shape
(512, 512)
vol = np.stack([im1, im2, im3])vol.shape
(3, 512, 512)
imageio.volread():
import os
os.listdir('chest-data')
['chest-000.dcm',
'chest-001.dcm',
'chest-002.dcm',
...,
'chest-049.dcm']
import imageio.v2 as imageio vol = imageio.volread('chest-data', format='DICOM')vol.shape
(50, 512, 512)
图像形状(shape):各轴的元素数
import imageio.v2 as imageio
vol = imageio.volread(
'chest-data', format='DICOM')
# 图像形状(体素)
n0, n1, n2 = vol.shape
n0, n1, n2
(50, 512, 512)
视野范围(FOV):各轴覆盖的物理长度
采样间距:每个元素覆盖的物理长度
# 采样间距(毫米)
d0, d1, d2 = vol.meta['sampling']
d0, d1, d2
(2, 0.5, 0.5)
# 视野范围(毫米)
n0 * d0, n1 * d1, n2 * d2
(100, 256, 256)
Python 中的生物医学图像分析