載入體積資料
ImageIO 的 volread() 函式可以載入多維資料集,並從影像資料夾建立 3D 體積資料。它也能彙整多張影像的中繼資料。
在這個練習中,請從包含 25 張 DICOM 影像的 "tcia-chest-ct" 資料夾讀入整個腦部體積資料。
本練習屬於課程
Python 的生醫影像分析
練習說明
- 使用
volread()載入目錄 "tcia-chest-ct"。 - 使用
vol.meta的keys()方法列印可用的中繼資料。 - 列印體積資料的
shape。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Import ImageIO
import imageio.v2 as ____
# Load the "tcia-chest-ct" directory
vol = ____
# Print image attributes
print('Available metadata:', ____)
print('Shape of image array:', ____)