N 维图像

Python 中的生物医学图像分析

Stephen Bailey

Instructor

各种形状与尺寸的图像

im[row, col]

足部 X 光

Python 中的生物医学图像分析

各种形状与尺寸的图像

vol[pln, row, col]

身体切面动画

Python 中的生物医学图像分析

各种形状与尺寸的图像

im[row, col, ch]

细胞 RGB

Python 中的生物医学图像分析

各种形状与尺寸的图像

im_ts[time, row, col, ch]

细胞视频

Python 中的生物医学图像分析

N 维图像是数组的堆栈

略微错位的图像栈

import imageio.v2 as imageio
import numpy as np

im1=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)
Python 中的生物医学图像分析

直接加载体数据

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)
Python 中的生物医学图像分析

形状、采样、视野范围

 图像形状(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 中的生物医学图像分析

Passons à la pratique !

Python 中的生物医学图像分析

Preparing Video For Download...