N-dimensionale Bilder

Biomedizinische Bildanalyse mit Python

Stephen Bailey

Instructor

Bilder in allen Formen und Größen

im[row, col]

Fuß-Röntgen

Biomedizinische Bildanalyse mit Python

Bilder in allen Formen und Größen

vol[pln, row, col]

Körper-GIF

Biomedizinische Bildanalyse mit Python

Bilder in allen Formen und Größen

im[row, col, ch]

Zelle RGB

Biomedizinische Bildanalyse mit Python

Bilder in allen Formen und Größen

im_ts[time, row, col, ch]

Zell-Video

Biomedizinische Bildanalyse mit Python

N-dimensionale Bilder sind Stapel von Arrays

Stapel von Bildern, leicht versetzt

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)
Biomedizinische Bildanalyse mit Python

Volumina direkt laden

imageio.volread():

  • mehrdimensionale Daten direkt einlesen
  • aus mehreren Bildern ein Volumen erstellen
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)
Biomedizinische Bildanalyse mit Python

Form, Abtastrate und Sichtfeld

 Bildform: Anzahl der Elemente entlang jeder Achse

import imageio.v2 as imageio
vol = imageio.volread(
            'chest-data', format='DICOM')
# Image shape (in voxels)
n0, n1, n2 = vol.shape
n0, n1, n2
(50, 512, 512)

Sichtfeld: abgedeckter physikalischer Raum je Achse

Abtastrate: physikalischer Raum pro Element

# Sampling rate (in mm)
d0, d1, d2 = vol.meta['sampling']
d0, d1, d2
(2, 0.5, 0.5)
# Field of view (in mm)
n0 * d0, n1 * d1, n2 * d2
(100, 256, 256)
Biomedizinische Bildanalyse mit Python

Lass uns üben!

Biomedizinische Bildanalyse mit Python

Preparing Video For Download...