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 的生醫影像分析

形狀、取樣、視野範圍

 影像形狀:各軸向的元素數

import imageio.v2 as imageio
vol = imageio.volread(
            'chest-data', format='DICOM')
# 影像形狀(體素)
n0, n1, n2 = vol.shape
n0, n1, n2
(50, 512, 512)

視野範圍:各軸向涵蓋的實體長度

取樣率:每個元素對應的實體長度

# 取樣率(mm)
d0, d1, d2 = vol.meta['sampling']
d0, d1, d2
(2, 0.5, 0.5)
# 視野範圍(mm)
n0 * d0, n1 * d1, n2 * d2
(100, 256, 256)
Python 的生醫影像分析

一起來練習吧!

Python 的生醫影像分析

Preparing Video For Download...